From 6be6db31bc74693ce5516e1fd5e5ff1171005e37 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Mar 2025 14:27:10 +0100 Subject: [PATCH 1/5] Update VERSION for 6.4.20 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index ccc51981eb..49f3b698ac 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.4.20-DEV'; + public const VERSION = '6.4.20'; public const VERSION_ID = 60420; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 20; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2026'; public const END_OF_LIFE = '11/2027'; From a83a10df1be98a678f83e75249d790fd98e47fed Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Mar 2025 14:32:20 +0100 Subject: [PATCH 2/5] Bump Symfony version to 6.4.21 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index 49f3b698ac..dd80ab6175 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.4.20'; - public const VERSION_ID = 60420; + public const VERSION = '6.4.21-DEV'; + public const VERSION_ID = 60421; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 20; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 21; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2026'; public const END_OF_LIFE = '11/2027'; From edea8d1f4404e9b54d1adcafe13c25053f1868b7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 28 Mar 2025 14:38:46 +0100 Subject: [PATCH 3/5] Bump Symfony version to 7.2.6 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index d2e1eda84c..79b84228d2 100644 --- a/Kernel.php +++ b/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '7.2.5'; - public const VERSION_ID = 70205; + public const VERSION = '7.2.6-DEV'; + public const VERSION_ID = 70206; public const MAJOR_VERSION = 7; public const MINOR_VERSION = 2; - public const RELEASE_VERSION = 5; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 6; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '07/2025'; public const END_OF_LIFE = '07/2025'; From eade992bdf9017cf85fca5bb2404a0069ffab71c Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Mon, 7 Apr 2025 11:34:28 +0200 Subject: [PATCH 4/5] Do not ignore enum when Autowire attribute in RegisterControllerArgumentLocatorsPass When moving services injected from the constructor to the controller arguments, I noticed a bug. We were auto wiring an env var to a backed enum like this: ```php class Foo { public function __construct( #[Autowire(env: 'enum:App\Enum:SOME_ENV_KEY')] private \App\Enum $someEnum, ) {} public function __invoke() {} } ``` This works fine with normal Symfony Dependency Injection. But when we switch to controller arguments like this: ```php class Foo { public function __invoke( #[Autowire(env: 'enum:App\Enum:SOME_ENV_KEY')] \App\Enum $someEnum, ) {} } ``` This stops working. The issue is that BackedEnum's are excluded. But this should only be excluded when there is no Autowire attribute. --- .../RegisterControllerArgumentLocatorsPass.php | 2 +- .../RegisterControllerArgumentLocatorsPassTest.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/DependencyInjection/RegisterControllerArgumentLocatorsPass.php index 65bf1ef4c8..7d13c223a6 100644 --- a/DependencyInjection/RegisterControllerArgumentLocatorsPass.php +++ b/DependencyInjection/RegisterControllerArgumentLocatorsPass.php @@ -159,7 +159,7 @@ public function process(ContainerBuilder $container) continue; } elseif (!$autowire || (!($autowireAttributes ??= $p->getAttributes(Autowire::class, \ReflectionAttribute::IS_INSTANCEOF)) && (!$type || '\\' !== $target[0]))) { continue; - } elseif (is_subclass_of($type, \UnitEnum::class)) { + } elseif (!$autowireAttributes && is_subclass_of($type, \UnitEnum::class)) { // do not attempt to register enum typed arguments if not already present in bindings continue; } elseif (!$p->allowsNull()) { diff --git a/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index d2927b16f4..0a8c488edc 100644 --- a/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -498,13 +498,14 @@ public function testAutowireAttribute() $locator = $container->get($locatorId)->get('foo::fooAction'); - $this->assertCount(9, $locator->getProvidedServices()); + $this->assertCount(10, $locator->getProvidedServices()); $this->assertInstanceOf(\stdClass::class, $locator->get('service1')); $this->assertSame('foo/bar', $locator->get('value')); $this->assertSame('foo', $locator->get('expression')); $this->assertInstanceOf(\stdClass::class, $locator->get('serviceAsValue')); $this->assertInstanceOf(\stdClass::class, $locator->get('expressionAsValue')); $this->assertSame('bar', $locator->get('rawValue')); + $this->stringContains('Symfony_Component_HttpKernel_Tests_Fixtures_Suit_APP_SUIT', $locator->get('suit')); $this->assertSame('@bar', $locator->get('escapedRawValue')); $this->assertSame('foo', $locator->get('customAutowire')); $this->assertInstanceOf(FooInterface::class, $autowireCallable = $locator->get('autowireCallable')); @@ -719,6 +720,8 @@ public function fooAction( \stdClass $expressionAsValue, #[Autowire('bar')] string $rawValue, + #[Autowire(env: 'enum:\Symfony\Component\HttpKernel\Tests\Fixtures\Suit:APP_SUIT')] + Suit $suit, #[Autowire('@@bar')] string $escapedRawValue, #[CustomAutowire('some.parameter')] From f9dec01e6094a063e738f8945ef69c0cfcf792ec Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 2 May 2025 11:04:03 +0200 Subject: [PATCH 5/5] Update VERSION for 7.2.6 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 79b84228d2..12f65d3a89 100644 --- a/Kernel.php +++ b/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '7.2.6-DEV'; + public const VERSION = '7.2.6'; public const VERSION_ID = 70206; public const MAJOR_VERSION = 7; public const MINOR_VERSION = 2; public const RELEASE_VERSION = 6; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '07/2025'; public const END_OF_LIFE = '07/2025';