8000 [HttpKernel] Remove always-true condition on existence of DI `Autowire` class by GromNaN · Pull Request #60079 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Remove always-true condition on existence of DI Autowire class #60079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

GromNaN
Copy link
Member
@GromNaN GromNaN commented Mar 28, 2025
Q A
Branch? 7.3
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

This condition was introduced in #45657

The class RegisterControllerArgumentLocatorsPass requires the DI component, which cannot be < 6.4 due to a conflict rule in composer.json. So the Autoconfigure class always exists.

Introduced in symfony#45657

symfony/dependency-injection 6.4+ is required, so the class always exists
@@ -129,7 +127,7 @@ public function process(ContainerBuilder $container): void
/** @var \ReflectionParameter $p */
$type = preg_replace('/(^|[(|&])\\\\/', '\1', $target = ltrim(ProxyHelper::exportType($p) ?? '', '?'));
$invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
$autowireAttributes = $autowire ? $emptyAutowireAttributes : [];
$autowireAttributes = null;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $autowireAttributes is used in 1 place when $autowire is true. But still need to be reset on each loop.

@chalasr
Copy link
Member
chalasr commented Mar 28, 2025

For 7.2?

@GromNaN
Copy link
Member Author
GromNaN commented Mar 28, 2025

For 7.2?

That's a minor cleanup, not a bug. So I think the rule is to merge into 7.3.

@GromNaN GromNaN merged commit d442a43 into symfony:7.3 Mar 28, 2025
10 of 11 checks passed
@GromNaN GromNaN deleted the clean-autowire branch March 28, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0