10000 [DependencyInjection][HttpKernel] Fix enum typed bindings · symfony/http-kernel@c528c20 · GitHub
[go: up one dir, main page]

Skip to content

Commit c528c20

Browse files
committed
[DependencyInjection][HttpKernel] Fix enum typed bindings
1 parent 1f0c4e1 commit c528c20

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

DependencyInjection/RegisterControllerArgumentLocatorsPass.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ public function process(ContainerBuilder $container)
127127
$type = ltrim($target = (string) ProxyHelper::getTypeHint($r, $p), '\\');
128128
$invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
129129

130-
if (is_subclass_of($type, \UnitEnum::class)) {
131-
// do not attempt to register enum typed arguments
132-
continue;
133-
}
134-
135130
if (isset($arguments[$r->name][$p->name])) {
136131
$target = $arguments[$r->name][$p->name];
137132
if ('?' !== $target[0]) {
@@ -156,6 +151,9 @@ public function process(ContainerBuilder $container)
156151
$args[$p->name] = $bindingValue;
157152
}
158153

154+
continue;
155+
} elseif (is_subclass_of($type, \UnitEnum::class)) {
156+
// do not attempt to register enum typed arguments if not already present in bindings
159157
continue;
160158
} elseif (!$type || !$autowire || '\\' !== $target[0]) {
161159
continue;

0 commit comments

Comments
 (0)
0