From 9df8e51501cce65c7b259f4644663aa0476c9501 Mon Sep 17 00:00:00 2001 From: matlec Date: Fri, 30 May 2025 13:06:20 +0200 Subject: [PATCH 01/14] Fix `ContainerDebugCommandTest::testNoDumpedXML` --- Tests/Functional/ContainerDebugCommandTest.php | 2 +- Tests/Functional/app/ContainerDebug/no_dump.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 Tests/Functional/app/ContainerDebug/no_dump.yml diff --git a/Tests/Functional/ContainerDebugCommandTest.php b/Tests/Functional/ContainerDebugCommandTest.php index 24c6faf33..291a67cb8 100644 --- a/Tests/Functional/ContainerDebugCommandTest.php +++ b/Tests/Functional/ContainerDebugCommandTest.php @@ -53,7 +53,7 @@ public function testNoDebug() public function testNoDumpedXML() { - static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml', 'debug' => true, 'debug.container.dump' => false]); + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'no_dump.yml', 'debug' => true]); $application = new Application(static::$kernel); $application->setAutoExit(false); diff --git a/Tests/Functional/app/ContainerDebug/no_dump.yml b/Tests/Functional/app/ContainerDebug/no_dump.yml new file mode 100644 index 000000000..a9c709e9a --- /dev/null +++ b/Tests/Functional/app/ContainerDebug/no_dump.yml @@ -0,0 +1,5 @@ +imports: + - { resource: config.yml } + +parameters: + debug.container.dump: false From 9b1edd26071775162c2df241634496fbbe683399 Mon Sep 17 00:00:00 2001 From: Indra Gunawan Date: Mon, 2 Jun 2025 16:16:20 +0800 Subject: [PATCH 02/14] [FrameworkBundle] set NamespacedPoolInterface alias to cache.app --- DependencyInjection/FrameworkExtension.php | 4 ++++ Resources/config/cache.php | 3 +++ 2 files changed, 7 insertions(+) diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index 347f3ed65..64d27bca9 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -302,6 +302,10 @@ public function load(array $configs, ContainerBuilder $container): void // Load Cache configuration first as it is used by other components $loader->load('cache.php'); + if (!interface_exists(NamespacedPoolInterface::class)) { + $container->removeAlias(NamespacedPoolInterface::class); + } + $configuration = $this->getConfiguration($configs, $container); $config = $this->processConfiguration($configuration, $configs); diff --git a/Resources/config/cache.php b/Resources/config/cache.php index 3d96ba059..ae9d426a4 100644 --- a/Resources/config/cache.php +++ b/Resources/config/cache.php @@ -28,6 +28,7 @@ use Symfony\Component\Cache\Messenger\EarlyExpirationHandler; use Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer; use Symfony\Contracts\Cache\CacheInterface; +use Symfony\Contracts\Cache\NamespacedPoolInterface; use Symfony\Contracts\Cache\TagAwareCacheInterface; return static function (ContainerConfigurator $container) { @@ -250,6 +251,8 @@ ->alias(CacheInterface::class, 'cache.app') + ->alias(NamespacedPoolInterface::class, 'cache.app') + ->alias(TagAwareCacheInterface::class, 'cache.app.taggable') ; }; From 5df58fd260e6f0902f2719803818c689972e175b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 3 Jun 2025 08:30:01 +0200 Subject: [PATCH 03/14] don't register SchedulerTriggerNormalizer without symfony/serializer --- DependencyInjection/FrameworkExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index 64d27bca9..05504af2e 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -2297,7 +2297,7 @@ private function registerSchedulerConfiguration(ContainerBuilder $container, Php } // BC layer Scheduler < 7.3 - if (!class_exists(SchedulerTriggerNormalizer::class)) { + if (!ContainerBuilder::willBeAvailable('symfony/serializer', DenormalizerInterface::class, ['symfony/framework-bundle', 'symfony/scheduler']) || !class_exists(SchedulerTriggerNormalizer::class)) { $container->removeDefinition('serializer.normalizer.scheduler_trigger'); } } From 35a2a545f553c30c4679d3797456f82f3d77e08c Mon Sep 17 00:00:00 2001 From: Carlos Quintana Date: Tue, 27 May 2025 14:57:57 +0200 Subject: [PATCH 04/14] [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass --- Test/KernelTestCase.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Test/KernelTestCase.php b/Test/KernelTestCase.php index ee67fa7af..e87ac4824 100644 --- a/Test/KernelTestCase.php +++ b/Test/KernelTestCase.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Test; +use PHPUnit\Framework\Attributes\AfterClass; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -120,8 +121,11 @@ protected static function createKernel(array $options = []): KernelInterface /** * Shuts the kernel down if it was used in the test - called by the tearDown method by default. + * + * @afterClass */ - protected static function ensureKernelShutdown() + #[AfterClass] + public static function ensureKernelShutdown() { if (null !== static::$kernel) { static::$kernel->boot(); From fe8367b6b3593e5451e419c00afd7e780cfce647 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 4 Jun 2025 15:57:42 +0200 Subject: [PATCH 05/14] Revert "bug #60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)" This reverts commit ec76ab4f28454ebfbcf14287b2aac1351f00df79, reversing changes made to bc886008906f022a8fbf9796b943af928b64d86c. --- Test/KernelTestCase.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Test/KernelTestCase.php b/Test/KernelTestCase.php index e87ac4824..ee67fa7af 100644 --- a/Test/KernelTestCase.php +++ b/Test/KernelTestCase.php @@ -11,7 +11,6 @@ namespace Symfony\Bundle\FrameworkBundle\Test; -use PHPUnit\Framework\Attributes\AfterClass; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -121,11 +120,8 @@ protected static function createKernel(array $options = []): KernelInterface /** * Shuts the kernel down if it was used in the test - called by the tearDown method by default. - * - * @afterClass */ - #[AfterClass] - public static function ensureKernelShutdown() + protected static function ensureKernelShutdown() { if (null !== static::$kernel) { static::$kernel->boot(); From 26ca2357cab5dfe862f2bbf397bd1459a8901af8 Mon Sep 17 00:00:00 2001 From: Carlos Quintana Date: Tue, 27 May 2025 14:57:57 +0200 Subject: [PATCH 06/14] [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass --- Test/KernelTestCase.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Test/KernelTestCase.php b/Test/KernelTestCase.php index ee67fa7af..1312f6592 100644 --- a/Test/KernelTestCase.php +++ b/Test/KernelTestCase.php @@ -45,6 +45,14 @@ protected function tearDown(): void static::$booted = false; } + public static function tearDownAfterClass(): void + { + static::ensureKernelShutdown(); + static::$class = null; + static::$kernel = null; + static::$booted = false; + } + /** * @throws \RuntimeException * @throws \LogicException From 4e7ea17b45e01c02d2462901ef2eeab252237e0a Mon Sep 17 00:00:00 2001 From: Jack Worman Date: Thu, 12 Jun 2025 13:41:08 -0400 Subject: [PATCH 07/14] Fix-type-error-when-revealing-broken-secret --- Command/SecretsRevealCommand.php | 4 ++++ Secrets/AbstractVault.php | 3 +++ Secrets/DotenvVault.php | 4 ++-- Tests/Command/SecretsRevealCommandTest.php | 13 +++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Command/SecretsRevealCommand.php b/Command/SecretsRevealCommand.php index 150186b1d..c2110ee76 100644 --- a/Command/SecretsRevealCommand.php +++ b/Command/SecretsRevealCommand.php @@ -61,6 +61,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!\array_key_exists($name, $secrets)) { $io->error(\sprintf('The secret "%s" does not exist.', $name)); + return self::INVALID; + } elseif (null === $secrets[$name]) { + $io->error(\sprintf('The secret "%s" could not be decrypted.', $name)); + return self::INVALID; } diff --git a/Secrets/AbstractVault.php b/Secrets/AbstractVault.php index 882ec7862..788601d2e 100644 --- a/Secrets/AbstractVault.php +++ b/Secrets/AbstractVault.php @@ -31,6 +31,9 @@ abstract public function reveal(string $name): ?string; abstract public function remove(string $name): bool; + /** + * @return array + */ abstract public function list(bool $reveal = false): array; protected function validateName(string $name): void diff --git a/Secrets/DotenvVault.php b/Secrets/DotenvVault.php index 15952611a..3fab5f4e2 100644 --- a/Secrets/DotenvVault.php +++ b/Secrets/DotenvVault.php @@ -89,13 +89,13 @@ public function list(bool $reveal = false): array foreach ($_ENV as $k => $v) { if ('' !== ($v ?? '') && preg_match('/^\w+$/D', $k)) { - $secrets[$k] = $reveal ? $v : null; + $secrets[$k] = \is_string($v) && $reveal ? $v : null; } } foreach ($_SERVER as $k => $v) { if ('' !== ($v ?? '') && preg_match('/^\w+$/D', $k)) { - $secrets[$k] = $reveal ? $v : null; + $secrets[$k] = \is_string($v) && $reveal ? $v : null; } } diff --git a/Tests/Command/SecretsRevealCommandTest.php b/Tests/Command/SecretsRevealCommandTest.php index 94643db2c..d77d303d5 100644 --- a/Tests/Command/SecretsRevealCommandTest.php +++ b/Tests/Command/SecretsRevealCommandTest.php @@ -46,6 +46,19 @@ public function testInvalidName() $this->assertStringContainsString('The secret "undefinedKey" does not exist.', trim($tester->getDisplay(true))); } + public function testFailedDecrypt() + { + $vault = $this->createMock(AbstractVault::class); + $vault->method('list')->willReturn(['secretKey' => null]); + + $command = new SecretsRevealCommand($vault); + + $tester = new CommandTester($command); + $this->assertSame(Command::INVALID, $tester->execute(['name' => 'secretKey'])); + + $this->assertStringContainsString('The secret "secretKey" could not be decrypted.', trim($tester->getDisplay(true))); + } + /** * @backupGlobals enabled */ From e06d87953e87342ac936be939c496712ab9ef6e8 Mon Sep 17 00:00:00 2001 From: rhel-eo Date: Thu, 5 Jun 2025 10:54:16 +0100 Subject: [PATCH 08/14] [FrameworkBundle] Fix allow `loose` as an email validation mode --- DependencyInjection/Configuration.php | 2 +- Tests/DependencyInjection/PhpFrameworkExtensionTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index bae8967a8..6bed89cf1 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -1067,7 +1067,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e ->validate()->castToArray()->end() ->end() ->scalarNode('translation_domain')->defaultValue('validators')->end() - ->enumNode('email_validation_mode')->values((class_exists(Email::class) ? Email::VALIDATION_MODES : ['html5-allow-no-tld', 'html5', 'strict']) + ['loose'])->end() + ->enumNode('email_validation_mode')->values(array_merge(class_exists(Email::class) ? Email::VALIDATION_MODES : ['html5-allow-no-tld', 'html5', 'strict'], ['loose']))->end() ->arrayNode('mapping') ->addDefaultsIfNotSet() ->fixXmlConfig('path') diff --git a/Tests/DependencyInjection/PhpFrameworkExtensionTest.php b/Tests/DependencyInjection/PhpFrameworkExtensionTest.php index e5cc8522a..bd455d648 100644 --- a/Tests/DependencyInjection/PhpFrameworkExtensionTest.php +++ b/Tests/DependencyInjection/PhpFrameworkExtensionTest.php @@ -272,5 +272,6 @@ public static function emailValidationModeProvider() foreach (Email::VALIDATION_MODES as $mode) { yield [$mode]; } + yield ['loose']; } } From 9064cf54d1435b9b3c1f5b3dd39b9933d7074f2f Mon Sep 17 00:00:00 2001 From: Max Baldanza Date: Fri, 13 Jun 2025 10:34:24 +0100 Subject: [PATCH 09/14] [FrameworkBundle] Fix argument not provided to `add_bus_name_stamp_middleware` The bus name only gets provided to `add_bus_name_stamp_middleware` if using the default middlewares meaning that if you want to define the middlewares yourself then you need to define this service or you get an error: `Too few arguments to function Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware::__construct(), 0 passed` --- DependencyInjection/FrameworkExtension.php | 10 ++++---- .../Fixtures/php/messenger_bus_name_stamp.php | 24 +++++++++++++++++++ .../Fixtures/xml/messenger_bus_name_stamp.xml | 20 ++++++++++++++++ .../Fixtures/yml/messenger_bus_name_stamp.yml | 17 +++++++++++++ .../FrameworkExtensionTestCase.php | 22 +++++++++++++++++ 5 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php create mode 100644 Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml create mode 100644 Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index 68386120e..40834b385 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -2214,16 +2214,18 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder $defaultMiddleware['after'][0]['arguments'] = [$bus['default_middleware']['allow_no_senders']]; $defaultMiddleware['after'][1]['arguments'] = [$bus['default_middleware']['allow_no_handlers']]; - // argument to add_bus_name_stamp_middleware - $defaultMiddleware['before'][0]['arguments'] = [$busId]; - $middleware = array_merge($defaultMiddleware['before'], $middleware, $defaultMiddleware['after']); } - foreach ($middleware as $middlewareItem) { + foreach ($middleware as $key => $middlewareItem) { if (!$validationEnabled && \in_array($middlewareItem['id'], ['validation', 'messenger.middleware.validation'], true)) { throw new LogicException('The Validation middleware is only available when the Validator component is installed and enabled. Try running "composer require symfony/validator".'); } + + // argument to add_bus_name_stamp_middleware + if ('add_bus_name_stamp_middleware' === $middlewareItem['id']) { + $middleware[$key]['arguments'] = [$busId]; + } } if ($container->getParameter('kernel.debug') && class_exists(Stopwatch::class)) { diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php b/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php new file mode 100644 index 000000000..5c9c3c310 --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php @@ -0,0 +1,24 @@ +loadFromExtension('framework', [ + 'annotations' => false, + 'http_method_override' => false, + 'handle_all_throwables' => true, + 'php_errors' => ['log' => true], + 'messenger' => [ + 'default_bus' => 'messenger.bus.commands', + 'buses' => [ + 'messenger.bus.commands' => [ + 'default_middleware' => false, + 'middleware' => [ + 'add_bus_name_stamp_middleware', + 'send_message', + 'handle_message', + ], + ], + 'messenger.bus.events' => [ + 'default_middleware' => true, + ], + ], + ], +]); diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml new file mode 100644 index 000000000..bef24ed53 --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml new file mode 100644 index 000000000..954c66ae9 --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml @@ -0,0 +1,17 @@ +framework: + annotations: false + http_method_override: false + handle_all_throwables: true + php_errors: + log: true + messenger: + default_bus: messenger.bus.commands + buses: + messenger.bus.commands: + default_middleware: false + middleware: + - "add_bus_name_stamp_middleware" + - "send_message" + - "handle_message" + messenger.bus.events: + default_middleware: true diff --git a/Tests/DependencyInjection/FrameworkExtensionTestCase.php b/Tests/DependencyInjection/FrameworkExtensionTestCase.php index 7f94b83ce..11dd7e848 100644 --- a/Tests/DependencyInjection/FrameworkExtensionTestCase.php +++ b/Tests/DependencyInjection/FrameworkExtensionTestCase.php @@ -1102,6 +1102,28 @@ public function testMessengerWithMultipleBuses() $this->assertSame('messenger.bus.commands', (string) $container->getAlias('messenger.default_bus')); } + public function testMessengerWithAddBusNameStampMiddleware() + { + $container = $this->createContainerFromFile('messenger_bus_name_stamp'); + + $this->assertTrue($container->has('messenger.bus.commands')); + $this->assertEquals([ + ['id' => 'add_bus_name_stamp_middleware', 'arguments' => ['messenger.bus.commands']], + ['id' => 'send_message', 'arguments' => []], + ['id' => 'handle_message', 'arguments' => []], + ], $container->getParameter('messenger.bus.commands.middleware')); + $this->assertTrue($container->has('messenger.bus.events')); + $this->assertSame([], $container->getDefinition('messenger.bus.events')->getArgument(0)); + $this->assertEquals([ + ['id' => 'add_bus_name_stamp_middleware', 'arguments' => ['messenger.bus.events']], + ['id' => 'reject_redelivered_message_middleware'], + ['id' => 'dispatch_after_current_bus'], + ['id' => 'failed_message_processing_middleware'], + ['id' => 'send_message', 'arguments' => [true]], + ['id' => 'handle_message', 'arguments' => [false]], + ], $container->getParameter('messenger.bus.events.middleware')); + } + public function testMessengerMiddlewareFactoryErroneousFormat() { $this->expectException(\InvalidArgumentException::class); From 86c4522c2deeddeec8e95900bf3febb9b4aa79ef Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 20 Jun 2025 14:36:46 +0200 Subject: [PATCH 10/14] disable the Lock integration to not register the deduplicate middleware --- .../Fixtures/php/messenger_bus_name_stamp.php | 1 + .../Fixtures/xml/messenger_bus_name_stamp.xml | 1 + .../Fixtures/yml/messenger_bus_name_stamp.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php b/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php index 5c9c3c310..452594d45 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php @@ -5,6 +5,7 @@ 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true], + 'lock' => false, 'messenger' => [ 'default_bus' => 'messenger.bus.commands', 'buses' => [ diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml index bef24ed53..5e0b17851 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml @@ -8,6 +8,7 @@ + diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml index 954c66ae9..79f8d7c87 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml @@ -4,6 +4,7 @@ framework: handle_all_throwables: true php_errors: log: true + lock: false messenger: default_bus: messenger.bus.commands buses: From 49e2028790b099bda9fc9286f37bc74a7784f289 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 24 Jun 2025 22:48:06 +0200 Subject: [PATCH 11/14] [FrameworkBundle] also deprecate the internal rate limiter factory alias --- DependencyInjection/FrameworkExtension.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index eeab693ed..3757376f6 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -61,6 +61,7 @@ use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; +use Symfony\Component\DependencyInjection\Attribute\Target; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; @@ -3301,7 +3302,12 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde if (interface_exists(RateLimiterFactoryInterface::class)) { $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter'); - $factoryAlias->setDeprecated('symfony/dependency-injection', '7.3', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.'); + $factoryAlias->setDeprecated('symfony/dependency-injection', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName())); + $internalAliasId = \sprintf('.%s $%s.limiter', RateLimiterFactory::class, $name); + + if ($container->hasAlias($internalAliasId)) { + $container->getAlias($internalAliasId)->setDeprecated('symfony/framework-bundle', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName())); + } } } From 9f5a5402e62bbca87c14cb2d4919a0939ce86982 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 24 Jun 2025 22:24:45 +0200 Subject: [PATCH 12/14] fix package name in deprecation message --- DependencyInjection/FrameworkExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index 3757376f6..d3cefbb28 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -3302,7 +3302,7 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde if (interface_exists(RateLimiterFactoryInterface::class)) { $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter'); - $factoryAlias->setDeprecated('symfony/dependency-injection', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName())); + $factoryAlias->setDeprecated('symfony/framework-bundle', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName())); $internalAliasId = \sprintf('.%s $%s.limiter', RateLimiterFactory::class, $name); if ($container->hasAlias($internalAliasId)) { From ff892d3ab4b8aa35921bc2120a4b31d57948fe22 Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Thu, 26 Jun 2025 22:46:07 +0200 Subject: [PATCH 13/14] Fix command option mode (InputOption::VALUE_REQUIRED) --- Command/TranslationDebugCommand.php | 2 +- Command/TranslationUpdateCommand.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Command/TranslationDebugCommand.php b/Command/TranslationDebugCommand.php index ecb0ad8d7..53ee1949f 100644 --- a/Command/TranslationDebugCommand.php +++ b/Command/TranslationDebugCommand.php @@ -79,7 +79,7 @@ protected function configure(): void ->setDefinition([ new InputArgument('locale', InputArgument::REQUIRED, 'The locale'), new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'), - new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'The messages domain'), + new InputOption('domain', null, InputOption::VALUE_REQUIRED, 'The messages domain'), new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Display only missing messages'), new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Display only unused messages'), new InputOption('all', null, InputOption::VALUE_NONE, 'Load messages from all registered bundles'), diff --git a/Command/TranslationUpdateCommand.php b/Command/TranslationUpdateCommand.php index f8ce99c41..259027ce0 100644 --- a/Command/TranslationUpdateCommand.php +++ b/Command/TranslationUpdateCommand.php @@ -84,14 +84,14 @@ protected function configure(): void ->setDefinition([ new InputArgument('locale', InputArgument::REQUIRED, 'The locale'), new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'), - new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'), - new InputOption('format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'xlf12'), + new InputOption('prefix', null, InputOption::VALUE_REQUIRED, 'Override the default prefix', '__'), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'Override the default output format', 'xlf12'), new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'), new InputOption('force', null, InputOption::VALUE_NONE, 'Should the extract be done'), new InputOption('clean', null, InputOption::VALUE_NONE, 'Should clean not found messages'), - new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'Specify the domain to extract'), + new InputOption('domain', null, InputOption::VALUE_REQUIRED, 'Specify the domain to extract'), new InputOption('sort', null, InputOption::VALUE_OPTIONAL, 'Return list of messages sorted alphabetically (only works with --dump-messages)', 'asc'), - new InputOption('as-tree', null, InputOption::VALUE_OPTIONAL, 'Dump the messages as a tree-like structure: The given value defines the level where to switch to inline YAML'), + new InputOption('as-tree', null, InputOption::VALUE_REQUIRED, 'Dump the messages as a tree-like structure: The given value defines the level where to switch to inline YAML'), ]) ->setHelp(<<<'EOF' The %command.name% command extracts translation strings from templates From 89a21b5fc1e5c698712b70724af41416aa1109ae Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 27 Jun 2025 21:54:19 +0200 Subject: [PATCH 14/14] - --- Command/TranslationUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Command/TranslationUpdateCommand.php b/Command/TranslationUpdateCommand.php index b6cc23839..25fd1c91e 100644 --- a/Command/TranslationUpdateCommand.php +++ b/Command/TranslationUpdateCommand.php @@ -81,7 +81,7 @@ protected function configure(): void new InputOption('force', null, InputOption::VALUE_NONE, 'Should the extract be done'), new InputOption('clean', null, InputOption::VALUE_NONE, 'Should clean not found messages'), new InputOption('domain', null, InputOption::VALUE_REQUIRED, 'Specify the domain to extract'), - new InputOption('sort', null, InputOption::VALUE_OPTIONAL, 'Return list of messages sorted alphabetically'), + new InputOption('sort', null, InputOption::VALUE_REQUIRED, 'Return list of messages sorted alphabetically'), new InputOption('as-tree', null, InputOption::VALUE_REQUIRED, 'Dump the messages as a tree-like structure: The given value defines the level where to switch to inline YAML'), ]) ->setHelp(<<<'EOF'