-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add an auto_alias compiler pass #12526
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
Conversation
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
foreach ($container->findTaggedServiceIds('auto_alias') as $service_id => $tags) { |
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.
We only use camelCase variables in Symfony. Can you make the change everywhere? Thanks.
Updated the PR. |
|
||
$parameterValue = $container->getParameter($parameterName); | ||
$format = $tag['format']; | ||
$aliasId = str_replace('%s', $parameterValue, $format); |
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.
why not sprintf($format, $parameterValue)
?
PS: We could add a "Drupal" label onto this issue |
tag added |
{ | ||
foreach ($container->findTaggedServiceIds('auto_alias') as $serviceId => $tags) { | ||
// We don't want to deal with an existing alias. | ||
if ($container->hasAlias($serviceId)) { |
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.
this is actually not possible, given that aliases cannot have tags, only services can.
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.
Interesting, good to know!
Should we now make PRs against 2.7 for now or is 3.x the proper version and things are just broken atm.? |
Thank you @dawehner. |
Am I correct that this pass is not registered anywhere by default? |
@wouterj Yes, seems like this was missed. |
@wouterj @xabbuh @nicolas-grekas @fabpot |
@jean-pasqualini The best is to open a new issue so this doesn't get lost again. |
Discussion see #11460