@@ -26,30 +26,30 @@ class AutoAliasServicePass implements CompilerPassInterface
26
26
*/
27
27
public function process (ContainerBuilder $ container )
28
28
{
29
- foreach ($ container ->findTaggedServiceIds ('auto_alias ' ) as $ service_id => $ tags ) {
29
+ foreach ($ container ->findTaggedServiceIds ('auto_alias ' ) as $ serviceId => $ tags ) {
30
30
// We don't want to deal with an existing alias.
31
- if ($ container ->hasAlias ($ service_id )) {
31
+ if ($ container ->hasAlias ($ serviceId )) {
32
32
continue ;
33
33
}
34
34
foreach ($ tags as $ tag ) {
35
35
if (!isset ($ tag ['parameter_name ' ])) {
36
- throw new ParameterNotFoundException (sprintf ('Missing tag information "parameter_name" on auto_alias service %s ' , $ service_id ));
36
+ throw new ParameterNotFoundException (sprintf ('Missing tag information "parameter_name" on auto_alias service "%s". ' , $ serviceId ));
37
37
}
38
38
39
- $ parameter_name = $ tag ['parameter_name ' ];
40
- if (!$ container ->hasParameter ($ parameter_name )) {
41
- throw new ParameterNotFoundException (sprintf ('Missing parameter %s ' , $ parameter_name ));
39
+ $ parameterName = $ tag ['parameter_name ' ];
40
+ if (!$ container ->hasParameter ($ parameterName )) {
41
+ throw new ParameterNotFoundException (sprintf ('Missing parameter "%s" ' , $ parameterName ));
42
42
}
43
43
44
44
if (!isset ($ tag ['format ' ])) {
45
- throw new InvalidArgumentException (sprintf ('Missing tag information "format" on auto_alias service %s ' , $ service_id ));
45
+ throw new InvalidArgumentException (sprintf ('Missing tag information "format" on auto_alias service "%s". ' , $ serviceId ));
46
46
}
47
47
48
- $ parameter_value = $ container ->getParameter ($ parameter_name );
48
+ $ parameterValue = $ container ->getParameter ($ parameterName );
49
49
$ format = $ tag ['format ' ];
50
- $ alias_id = str_replace ('%s ' , $ parameter_value , $ format );
51
- if ($ container ->hasDefinition ($ alias_id ) || $ container ->hasAlias ($ alias_id )) {
52
- $ container ->setAlias ($ service_id , new Alias ($ alias_id ));
50
+ $ aliasId = str_replace ('%s ' , $ parameterValue , $ format );
51
+ if ($ container ->hasDefinition ($ aliasId ) || $ container ->hasAlias ($ aliasId )) {
52
+ $ container ->setAlias ($ serviceId , new Alias ($ aliasId ));
53
53
}
54
54
}
55
55
}
0 commit comments