Skip to content

Commit ddc2759

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: [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 5617b2e + a40037f commit ddc2759

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

DependencyInjection/RegisterControllerArgumentLocatorsPass.php

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

Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

Lines changed: 4 additions & 1 deletion
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)