Skip to content

Commit a40037f

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: [Intl] Update data to ICU 77.1 Correctly convert SIGSYS to its name fix(security): fix OIDC user identifier Do not ignore enum when Autowire attribute in RegisterControllerArgumentLocatorsPass fix RedisCluster seed if REDIS_CLUSTER_HOST env var is not set
2 parents edea8d1 + eade992 commit a40037f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

DependencyInjection/RegisterControllerArgumentLocatorsPass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function process(ContainerBuilder $container): void
157157
continue;
158158
} elseif (!$autowire || (!($autowireAttributes ??= $p->getAttributes(Autowire::class, \ReflectionAttribute::IS_INSTANCEOF)) && (!$type || '\\' !== $target[0]))) {
159159
continue;
160-
} elseif (is_subclass_of($type, \UnitEnum::class)) {
160+
} elseif (!$autowireAttributes && is_subclass_of($type, \UnitEnum::class)) {
161161
// do not attempt to register enum typed arguments if not already present in bindings
162162
continue;
163163
} elseif (!$p->allowsNull()) {

Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,14 @@ public function testAutowireAttribute()
503503

504504
$locator = $container->get($locatorId)->get('foo::fooAction');
505505

506-
$this->assertCount(9, $locator->getProvidedServices());
506+
$this->assertCount(10, $locator->getProvidedServices());
507507
$this->assertInstanceOf(\stdClass::class, $locator->get('service1'));
508508
$this->assertSame('foo/bar', $locator->get('value'));
509509
$this->assertSame('foo', $locator->get('expression'));
510510
$this->assertInstanceOf(\stdClass::class, $locator->get('serviceAsValue'));
511511
$this->assertInstanceOf(\stdClass::class, $locator->get('expressionAsValue'));
512512
$this->assertSame('bar', $locator->get('rawValue'));
513+
$this->stringContains('Symfony_Component_HttpKernel_Tests_Fixtures_Suit_APP_SUIT', $locator->get('suit'));
513514
$this->assertSame('@bar', $locator->get('escapedRawValue'));
514515
$this->assertSame('foo', $locator->get('customAutowire'));
515516
$this->assertInstanceOf(FooInterface::class, $autowireCallable = $locator->get('autowireCallable'));
@@ -752,6 +753,8 @@ public function fooAction(
752753
\stdClass $expressionAsValue,
753754
#[Autowire('bar')]
754755
string $rawValue,
756+
#[Autowire(env: 'enum:\Symfony\Component\HttpKernel\Tests\Fixtures\Suit:APP_SUIT')]
757+
Suit $suit,
755758
#[Autowire('@@bar')]
756759
string $escapedRawValue,
757760
#[CustomAutowire('some.parameter')]

0 commit comments

Comments
 (0)