Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] also deprecate the internal rate limiter factory alias #60894

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
Jun 26, 2025

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jun 24, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60783
License MIT

$factoryAlias->setDeprecated('symfony/dependency-injection', '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()));
$internalAliasId = \sprintf('.%s $%s.limiter', RateLimiterFactory::class, $name);

if ($container->hasAlias($internalAliasId)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

registerAliasForArgument() can register a second alias (that's what I call "internal alias" here):

if ($parsedName !== $name) {
$this->setAlias('.'.$type.' $'.$name, $type.' $'.$parsedName);
}

@UtechtDustin
Copy link

I searched for a long time why that deprecation message was shown although i already used the RateLimiterFactoryInterface for autowiring.
This PR seems fixing it, thanks @xabbuh.

@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit 716115c into symfony:7.3 Jun 26, 2025
16 of 17 checks passed
@xabbuh xabbuh deleted the issue-60783 branch June 26, 2025 07:03
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.

4 participants