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

Framework Extra Bundle Laravel Package

sensio/framework-extra-bundle

Provides annotation-based configuration for Symfony controllers (routing, security, templates, caching, etc.). Note: this bundle is no longer maintained—prefer native PHP attributes in Symfony core (ideally Symfony 6.2+) for full support.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Legacy Symfony Integration: The bundle is designed to extend Symfony’s FrameworkBundle by enabling annotation-based controller configuration (e.g., @Route, @ParamConverter, @Template). It fits seamlessly into Symfony 4.x/5.x architectures where annotations are still widely used (e.g., legacy codebases or teams resistant to PHP 8+ attributes).
  • Deprecation Risk: Since the bundle is archived and replaced by Symfony’s native PHP attributes (introduced in Symfony 6.2), integrating it introduces technical debt and future migration costs. Native attributes are the long-term standard, but annotations remain a stopgap for older systems.
  • Use Case Alignment:
    • Good Fit: Projects stuck on Symfony <6.2 with heavy annotation usage (e.g., Doctrine ORM, SensioLabs annotations).
    • Poor Fit: Greenfield projects or those targeting Symfony 6.2+ (should use #[Route] instead).

Integration Feasibility

  • Low Effort for Legacy Systems: Adding the bundle to composer.json and enabling it in config/bundles.php is trivial. Existing annotations (e.g., @Route("/path")) continue working without changes.
  • Dependency Conflicts: Risk of conflicts with other SensioLabs bundles (e.g., SensioGeneratorBundle) or Doctrine if not already aligned.
  • Testing Overhead: Annotations require Doctrine’s AnnotationReader, which may need explicit configuration in Symfony 5.x+ (where it’s deprecated in favor of Attribute).

Technical Risk

Risk Area Severity Mitigation Strategy
Deprecation High Plan migration to Symfony attributes (6.2+) with a timeline.
Annotation Parsing Medium Ensure doctrine/annotations is installed and configured.
Symfony Version Lock High Test compatibility with target Symfony version (e.g., 5.4 LTS).
Performance Low Annotations add minimal overhead vs. attributes.
Security Low No known vulnerabilities; MIT license is safe.

Key Questions

  1. Why not use native attributes?
    • Are you constrained by Symfony version (<6.2)?
    • Is the team unfamiliar with PHP 8 attributes?
  2. What’s the migration plan?
    • Will you incrementally replace annotations with attributes?
    • Do you have a cutoff date for deprecation?
  3. Are there other SensioLabs dependencies?
    • Could conflicts arise with SensioGeneratorBundle or Doctrine?
  4. How will you handle CI/CD?
    • Will you add deprecation warnings or blocker tests for annotation usage?

Integration Approach

Stack Fit

  • Symfony 4.x/5.x: Native support; no additional configuration needed beyond composer require.
  • PHP 7.4–8.1: Works, but PHP 8.1+ may trigger deprecation warnings for ReflectionClass::newInstanceArgs().
  • Doctrine ORM: Required for annotation parsing (ensure doctrine/annotations is installed).
  • Alternative Frameworks: Not applicable—this is Symfony-specific.

Migration Path

  1. Short-Term (Symfony <6.2):

    • Install via Composer:
      composer require sensio/framework-extra-bundle
      
    • Enable in config/bundles.php:
      return [
          // ...
          Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
      ];
      
    • Verify annotations work (e.g., @Route, @ParamConverter).
  2. Medium-Term (Symfony 6.2+):

    • Option A: Replace annotations with attributes (e.g., #[Route]).
      • Use symfony/flex or symfony/var-dumper to audit usage.
      • Tools like PHPStan can detect remaining annotations.
    • Option B: Use a polyfill (e.g., symfony/annotations) to bridge annotations to attributes temporarily.
  3. Long-Term:

    • Deprecate annotations via CI checks (e.g., fail builds if @Route is found).
    • Update documentation to reflect attribute usage.

Compatibility

  • Symfony 5.4 LTS: Fully compatible.
  • Symfony 6.0–6.1: Works but may emit deprecation warnings.
  • Symfony 6.2+: Not recommended—use native attributes instead.
  • Doctrine: Ensure doctrine/annotations is installed (Symfony 5+ may require explicit config):
    # config/packages/doctrine_annotations.yaml
    doctrine:
        orm:
            annotations: true
    

Sequencing

  1. Assess Scope: Audit controllers for annotation usage (e.g., grep -r "@Route" src/).
  2. Test Integration: Verify routes, param converters, and templates work post-install.
  3. Plan Migration: Prioritize controllers by business impact for attribute conversion.
  4. Deprecate Gradually: Add warnings in CI/CD for annotation usage.
  5. Cutover: Remove the bundle and update to attributes in a feature flagged release.

Operational Impact

Maintenance

  • Bundle Updates: None expected—project is archived. Depend on community for critical fixes.
  • Symfony Updates: May require manual testing for compatibility (e.g., Symfony 6.x).
  • Documentation: Outdated; rely on Symfony’s migration guide for attribute alternatives.

Support

  • Community: Limited—issue tracking is closed. Use Symfony Slack/Discord for workarounds.
  • Vendor Lock-in: None, but technical debt increases if annotations persist beyond Symfony 6.2.
  • Debugging: Annotation parsing errors may be opaque (e.g., malformed @ParamConverter configs).

Scaling

  • Performance: Negligible impact—annotations are parsed once per request.
  • Caching: Symfony’s annotation cache (cache/dev/annotations) may grow with large codebases.
  • Horizontal Scaling: No direct impact, but annotation parsing adds minor overhead vs. attributes.

Failure Modes

Scenario Impact Mitigation
Symfony 6.2+ upgrade Bundle breaks Migrate to attributes pre-upgrade.
Doctrine annotation parsing Routes/param converters fail Ensure doctrine/annotations is installed.
PHP 8.1+ deprecation warnings CI/CD failures Suppress warnings temporarily; plan migration.
Missing AnnotationReader Runtime errors Configure explicitly in Symfony 5+.

Ramp-Up

  • Developer Onboarding:
    • Document annotation vs. attribute differences.
    • Provide a migration checklist for new controllers.
  • CI/CD Pipeline:
    • Add a deprecation check (e.g., fail builds on @Route usage in dev).
    • Example GitHub Action:
      - name: Check for annotations
        run: |
          if grep -r "@Route" src/; then
            echo "ERROR: Annotations found. Use #[Route] instead."
            exit 1
          fi
      
  • Training:
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.
filament/spatie-laravel-tags-plugin
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi