theodo/framework-extra-bundle
A Symfony bundle that adds annotation and attribute support to controllers for routing, caching, security, templates, and request parameter conversion. This Theodo-maintained fork keeps the classic SensioFrameworkExtraBundle conveniences working on modern Symfony versions.
First, calibrate expectations: this is a Symfony 2-era bundle, not a Laravel package. If you're coming from Laravel, map the concepts before reading any code:
Extension class, registered in AppKernel::registerBundles()DependencyInjection/Configuration.php + config.yml under a bundle aliasMinimal steps:
composer require theodo/framework-extra-bundle (expect to pin a version manually — see Gotchas).new Theodo\FrameworkExtraBundle\TheodoFrameworkExtraBundle() in app/AppKernel.php (Symfony 2/3 only; there is no bundles.php/Flex recipe).src/ directory and any tests are the only reliable documentation — budget 15 minutes to read it end to end.First use case: pick a single utility class, instantiate it directly in a throwaway controller or a php bin/console command, and confirm it behaves as expected on your PHP version. Do not wire it broadly until you've validated autoloading, namespace, and runtime compatibility with your Symfony minor version.
If your target is Laravel or Symfony 4+, stop here — this bundle is not the right tool. For Symfony 4/5+, the equivalent "extra" features live in sensio/framework-extra-bundle (annotations, param converters, template listeners) and Symfony's own FrameworkBundle.
Treat it as a library, not a framework. Because the bundle is a collection of classes rather than an opinionated layer, the cleanest pattern is to consume individual classes as services or static helpers and leave the bundle registration minimal:
// services.yml
services:
app.your_helper:
class: AppBundle\Service\YourHelper
arguments: ['@theodo.some_service'] # only if the bundle exports such a service
If the bundle does not declare services in its DependencyInjection extension, don't invent them — instantiate the classes directly or wrap them in your own service.
Controller-level use. If it ships annotation helpers or base controller traits, use them alongside (not replacing) the standard SensioFrameworkExtraBundle annotations. Keep a single controller as a pilot and diff behaviour against a controller that doesn't use the bundle.
Workflow for evaluating a class safely:
tests/Unit/Theodo/...Test.php).KernelTestCase).Integration tip: if the bundle's Extension loads config under an alias, inspect what it actually registers via php bin/console container:debug --show-private and grep for the bundle namespace. This is faster than reading Configuration.php.
Migration-friendly usage. Because the package is effectively frozen, wrap any class you depend on behind your own interface. If the upstream code breaks on a PHP upgrade you can swap the implementation without touching call sites.
Symfony2 in the description) mean it almost certainly predates Symfony 4's bundle conventions. Expect no support, no fixes, and no compatibility with modern Symfony.symfony/symfony / symfony/framework-bundle. Expect to add "replace" entries, a minimum-stability override, or a fork.each(), dynamic properties, loose type juggling). Run a static analyser (PHPStan level 5+) over vendor/theodo/ before adopting.config/bundles.php registration and no config/packages/*.yaml — everything is manual AppKernel + app/config/config.yml. If your project is Flex-based, this bundle does not belong in it.sensio/framework-extra-bundle. Both are "extra" bundles; check for duplicate annotation listeners or route loaders before enabling both. Registering conflicting listeners silently changes routing or param conversion behaviour — the bug surfaces far from the cause.composer.json with PSR-0 mappings or a legacy autoload block. Verify with composer dump-autoload -o and a class_exists() smoke test.php bin/console debug:event-dispatcher and confirm the bundle's listeners are actually attached.symfony/* constraint, add a CI matrix over your PHP/Symfony versions, and tag a fork version. Keep the fork pinned by commit hash rather than branch.AppBundle/Util — which removes the upgrade and supply-chain risk entirely and is almost certainly the better outcome given zero dependents.How can I help you explore Laravel packages today?