From 8d8ecbe8807ae73df26051e64a4259e722d9b668 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Sat, 26 Sep 2026 22:55:35 +0200 Subject: [PATCH] Let Symfony Flex register the bundle Without a recipe, Flex registers the bundle class it finds under the name `Bundle` (`BrefSymfonyBridgeBundle`), whatever the package type, and ignores `extra.symfony.bundles`. `BrefBundle` was never registered, so the CloudWatch log formatter was never enabled on new applications. `BrefBundle` stays as a deprecated alias for applications that registered it. Claude-Session: https://claude.ai/code/session_0168N55uBK9UjfpL6r8oGjDm --- composer.json | 7 ------- src/BrefBundle.php | 12 ++++-------- src/BrefSymfonyBridgeBundle.php | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 src/BrefSymfonyBridgeBundle.php diff --git a/composer.json b/composer.json index c51fb73..200013a 100644 --- a/composer.json +++ b/composer.json @@ -40,13 +40,6 @@ "symfony/phpunit-bridge": "^6.0|^7.0|^8.0", "symfony/process": "^5.4|^6.0|^7.0|^8.0" }, - "extra": { - "symfony": { - "bundles": { - "Bref\\SymfonyBridge\\BrefBundle": ["all"] - } - } - }, "config": { "sort-packages": true, "allow-plugins": { diff --git a/src/BrefBundle.php b/src/BrefBundle.php index 8d0ca73..f2c40aa 100644 --- a/src/BrefBundle.php +++ b/src/BrefBundle.php @@ -2,13 +2,9 @@ namespace Bref\SymfonyBridge; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; - -class BrefBundle extends Bundle +/** + * @deprecated Register {@see BrefSymfonyBridgeBundle} instead, which Symfony Flex registers automatically. + */ +class BrefBundle extends BrefSymfonyBridgeBundle { - public function build(ContainerBuilder $container): void - { - $container->addCompilerPass(new CloudWatchMonologFormatterPass); - } } diff --git a/src/BrefSymfonyBridgeBundle.php b/src/BrefSymfonyBridgeBundle.php new file mode 100644 index 0000000..4afc44e --- /dev/null +++ b/src/BrefSymfonyBridgeBundle.php @@ -0,0 +1,18 @@ +Bundle`. + */ +class BrefSymfonyBridgeBundle extends Bundle +{ + public function build(ContainerBuilder $container): void + { + $container->addCompilerPass(new CloudWatchMonologFormatterPass); + } +}