@@ -1232,9 +1232,9 @@ private function addAliases()
1232
1232
$ code = " \$this->aliases = array( \n" ;
1233
1233
ksort ($ aliases );
1234
1234
foreach ($ aliases as $ alias => $ id ) {
1235
- $ id = ( string ) $ id ;
1235
+ $ id = $ this -> container -> normalizeId ( $ id) ;
1236
1236
while (isset ($ aliases [$ id ])) {
1237
- $ id = ( string ) $ aliases [$ id ];
1237
+ $ id = $ this -> container -> normalizeId ( $ aliases [$ id ]) ;
1238
1238
}
1239
1239
$ code .= ' ' .$ this ->doExport ($ alias ).' => ' .$ this ->doExport ($ id ).", \n" ;
1240
1240
}
@@ -1555,7 +1555,7 @@ private function getServiceCallsFromArguments(array $arguments, array &$calls, $
1555
1555
if (is_array ($ argument )) {
1556
1556
$ this ->getServiceCallsFromArguments ($ argument , $ calls , $ isPreInstance , $ callerId , $ behavior , $ step );
1557
1557
} elseif ($ argument instanceof Reference) {
1558
- $ id = ( string ) $ argument ;
1558
+ $ id = $ this -> container -> normalizeId ( $ argument) ;
1559
1559
1560
1560
if (!isset ($ calls [$ id ])) {
1561
1561
$ calls [$ id ] = (int ) ($ isPreInstance && isset ($ this ->circularReferences [$ callerId ][$ id ]));
@@ -1625,7 +1625,7 @@ private function hasReference($id, array $arguments, $deep = false, array &$visi
1625
1625
1626
1626
continue ;
1627
1627
} elseif ($ argument instanceof Reference) {
1628
- $ argumentId = ( string ) $ argument ;
1628
+ $ argumentId = $ this -> container -> normalizeId ( $ argument) ;
1629
1629
if ($ id === $ argumentId ) {
1630
1630
return true ;
1631
1631
}
@@ -1790,11 +1790,12 @@ private function dumpValue($value, $interpolate = true)
1790
1790
} elseif ($ value instanceof Variable) {
1791
1791
return '$ ' .$ value ;
1792
1792
} elseif ($ value instanceof Reference) {
1793
- if (null !== $ this ->referenceVariables && isset ($ this ->referenceVariables [$ id = (string ) $ value ])) {
1793
+ $ id = $ this ->container ->normalizeId ($ value );
1794
+ if (null !== $ this ->referenceVariables && isset ($ this ->referenceVariables [$ id ])) {
1794
1795
return $ this ->dumpValue ($ this ->referenceVariables [$ id ], $ interpolate );
1795
1796
}
1796
1797
1797
- return $ this ->getServiceCall (( string ) $ value , $ value );
1798
+ return $ this ->getServiceCall ($ id , $ value );
1798
1799
} elseif ($ value instanceof Expression) {
1799
1800
return $ this ->getExpressionLanguage ()->compile ((string ) $ value , array ('this ' => 'container ' ));
1800
1801
} elseif ($ value instanceof Parameter) {
@@ -1881,6 +1882,7 @@ private function getServiceCall($id, Reference $reference = null)
1881
1882
while ($ this ->container ->hasAlias ($ id )) {
1882
1883
$ id = (string ) $ this ->container ->getAlias ($ id );
1883
1884
}
1885
+ $ id = $ this ->container ->normalizeId ($ id );
1884
1886
1885
1887
if ('service_container ' === $ id ) {
1886
1888
return '$this ' ;
0 commit comments