For a type: symfony-bundle package without a recipe, Flex auto-registers it in config/bundles.php only if the concrete class file literally contains Symfony\Component\HttpKernel\Bundle\Bundle or ...\AbstractBundle — a raw str_contains() on the file bytes, no autoloading or reflection:
https://github.com/symfony/flex/blob/v2.11.0/src/SymfonyBundle.php#L109-L113
So a bundle extending an intermediate base (e.g. class MyBundle extends AbstractMyVendorBundle, where the vendor base extends AbstractBundle) has neither literal in its own file and is silently skipped — composer req installs it but never updates config/bundles.php. The check also doesn't match the Symfony 8 base Symfony\Component\DependencyInjection\Kernel\AbstractBundle.
I'd argue type: symfony-bundle should be enough on its own. Options for a PR:
- Reflection — at install time the class is autoloadable, so check
is_subclass_of($class, BundleInterface::class). Robust against intermediate bases and namespace moves.
- Remove the heuristic — trust the
symfony-bundle type.
- Fail loudly — if the package's class doesn't resolve to a
BundleInterface, throw rather than silently skipping.
Happy to make a PR.
For a
type: symfony-bundlepackage without a recipe, Flex auto-registers it inconfig/bundles.phponly if the concrete class file literally containsSymfony\Component\HttpKernel\Bundle\Bundleor...\AbstractBundle— a rawstr_contains()on the file bytes, no autoloading or reflection:https://github.com/symfony/flex/blob/v2.11.0/src/SymfonyBundle.php#L109-L113
So a bundle extending an intermediate base (e.g.
class MyBundle extends AbstractMyVendorBundle, where the vendor base extendsAbstractBundle) has neither literal in its own file and is silently skipped —composer reqinstalls it but never updatesconfig/bundles.php. The check also doesn't match the Symfony 8 baseSymfony\Component\DependencyInjection\Kernel\AbstractBundle.I'd argue
type: symfony-bundleshould be enough on its own. Options for a PR:is_subclass_of($class, BundleInterface::class). Robust against intermediate bases and namespace moves.symfony-bundletype.BundleInterface, throw rather than silently skipping.Happy to make a PR.