Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Resource Bundle Laravel Package

symfony-cmf/resource-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

The package now requires PHP 7.1+ and Symfony 4.0+, aligning with modern Laravel (v6+) standards. Start by verifying your environment meets these requirements via:

php -v && composer show symfony/http-foundation

For new projects, install via Composer:

composer require vendor/package-name

First use case: Migrate legacy code—replace Symfony 3.x/HHVM dependencies with updated equivalents (e.g., HttpFoundation v4+). Check the upgrading guide for Symfony-specific changes.


Implementation Patterns

1. Dependency Updates

  • Symfony 4+: Replace Symfony\Component\HttpFoundation usages with v4+ methods (e.g., Request::getContent()Request::getContent(false) for raw body).
  • PHP 7.1+: Leverage typed properties, null coalescing (??), and spaceship operator (<=>) if not already using them.

2. Workflow Adjustments

  • Testing: Update test suites to use PHPUnit 8+ and Symfony’s BrowserKit v4+.
  • CI/CD: Ensure your pipeline runs PHP 7.1+ (e.g., php:7.4 Docker images). Example .github/workflows/test.yml:
    jobs:
      test:
        runs-on: ubuntu-latest
        container: php:7.4-cli
    

3. Integration Tips

  • Laravel Packages: If this package integrates with others (e.g., spatie/laravel-activitylog), check their PHP/Symfony compatibility first.
  • Service Providers: Update register()/boot() methods to use Symfony 4+ container syntax if applicable.

Gotchas and Tips

Breaking Changes

  1. HHVM Drop: Remove hhvm from your .phpunit.xml or CI config if present.
  2. Symfony 3.x APIs: Common deprecated methods:
    • Request::get()Request::query() for GET params.
    • Response::setContent()Response::setContent($content) (no null default).
  3. PHP 5.6/7.0 Features: Replace:
    • list() with [] destructuring.
    • array_merge() with spread operator (...).

Debugging

  • Deprecation Warnings: Enable E_DEPRECATED in php.ini to catch Symfony 3.x holdovers:
    error_reporting = E_ALL | E_STRICT
    
  • Tooling: Use roave/security-advisories to audit for outdated Symfony packages:
    composer require --dev roave/security-advisories
    

Extension Points

  • Custom Request Handling: Extend Symfony\Component\HttpFoundation\Request via traits or decorators (Symfony 4+ supports this natively).
  • Performance: PHP 7.1+’s JIT compiler (if enabled) may improve heavy request processing.

Migration Checklist

  1. Update composer.json constraints (e.g., "symfony/http-foundation": "^4.0").
  2. Run composer update vendor/package-name --with-dependencies.
  3. Test all routes/controllers handling requests/responses.
  4. Replace HHVM-specific optimizations (e.g., hhvm.flags config).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity