-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[DependencyInjection] Add argument $target to ContainerBuilder::registerAliasForArgument()
#60910
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicolas-grekas
commented
Jun 26, 2025
| if ($container->hasAlias($internalAliasId)) { | ||
| $container->getAlias($internalAliasId)->setDeprecated('symfony/framework-bundle', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName())); | ||
| } | ||
| $factoryAlias->setDeprecated('symfony/framework-bundle', '7.3', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.'); |
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to use a short RateLimiterFactoryInterface, that's the only thing that one needs to change when upgrading.
chalasr
approved these changes
Jun 26, 2025
alexandre-daubois
approved these changes
Jun 26, 2025
Member
Author
|
Status: needs work This creates a convention that AutowirePass cannot handle at the moment. |
54f9d82 to
1e88ea0
Compare
…gisterAliasForArgument()`
1e88ea0 to
8b79ff5
Compare
This was referenced Oct 27, 2025
Merged
Merged
nicolas-grekas
added a commit
that referenced
this pull request
Dec 5, 2025
…with #[Target] (yoeunes) This PR was merged into the 7.4 branch. Discussion ---------- [DependencyInjection] Allow manual bindings on parameters with #[Target] | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT PR #60910 added a check in `ResolveBindingsPass` that skips parameters with the `#[Target]` attribute. This prevents users from manually overriding values via `bind` (or `_defaults`) and causes `"unused binding"` exceptions, even when the binding matches the parameter name. `Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: A binding is configured for an argument named "$arg" for service "service", but no corresponding argument has been found. It may be unused and should be removed, or it may have a typo.` Commits ------- 6fb5c67 [DependencyInjection] Allow manual bindings on parameters with #[Target]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes the API simpler and fixes
debug:autowiring, which now displays e.g.: