Skip to content

Commit fa8db48

Browse files
Merge branch '4.4' into 5.3
* 4.4: [DependencyInjection][HttpKernel] Fix enum typed bindings [CI] Remove macOS jobs Suppress psalm error for UndefinedDocblockClass for PHP 8.1 classes
2 parents fa04d14 + c528c20 commit fa8db48

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
@@ -140,11 +140,6 @@ public function process(ContainerBuilder $container)
140140
$type = ltrim($target = (string) ProxyHelper::getTypeHint($r, $p), '\\');
141141
$invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
142142

143-
if (is_subclass_of($type, \UnitEnum::class)) {
144-
// do not attempt to register enum typed arguments
145-
continue;
146-
}
147-
148143
if (isset($arguments[$r->name][$p->name])) {
149144
$target = $arguments[$r->name][$p->name];
150145
if ('?' !== $target[0]) {
@@ -169,6 +164,9 @@ public function process(ContainerBuilder $container)
169164
$args[$p->name] = $bindingValue;
170165
}
171166

167+
continue;
168+
} elseif (is_subclass_of($type, \UnitEnum::class)) {
169+
// do not attempt to register enum typed arguments if not already present in bindings
172170
continue;
173171
} elseif (!$type || !$autowire || '\\' !== $target[0]) {
174172
continue;

0 commit comments

Comments
 (0)