8000 Remove always-true condition · symfony/symfony@3975043 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3975043

Browse files
committed
Remove always-true condition
Introduced in #45657 symfony/dependency-injection 6.4+ is required, so the class always exists
1 parent 79ea49c commit 3975043

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public function process(ContainerBuilder $container): void
5151
}
5252
}
5353

54-
$emptyAutowireAttributes = class_exists(Autowire::class) ? null : [];
55-
5654
foreach ($container->findTaggedServiceIds('controller.service_arguments', true) as $id => $tags) {
5755
$def = $container->getDefinition($id);
5856
$def->setPublic(true);
@@ -129,7 +127,7 @@ public function process(ContainerBuilder $container): void
129127
/** @var \ReflectionParameter $p */
130128
$type = preg_replace('/(^|[(|&])\\\\/', '\1', $target = ltrim(ProxyHelper::exportType($p) ?? '', '?'));
131129
$invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
132-
$autowireAttributes = $autowire ? $emptyAutowireAttributes : [];
130+
$autowireAttributes = null;
133131
$parsedName = $p->name;
134132
$k = null;
135133

@@ -155,7 +153,7 @@ public function process(ContainerBuilder $container): void
155153
$args[$p->name] = $bindingValue;
156154

157155
continue;
158-
} elseif (!$autowire || (!($autowireAttributes ??= $p->getAttributes(Autowire::class, \ReflectionAttribute::IS_INSTANCEOF)) && (!$type || '\\' !== $target[0]))) {
156+
} elseif (!$autowire || (!($autowireAttributes = $p->getAttributes(Autowire::class, \ReflectionAttribute::IS_INSTANCEOF)) && (!$type || '\\' !== $target[0]))) {
159157
continue;
160158
} elseif (is_subclass_of($type, \UnitEnum::class)) {
161159
// do not attempt to register enum typed arguments if not already present in bindings

0 commit comments

Comments
 (0)
0