File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/Symfony/Component/DependencyInjection/Dumper Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -952,23 +952,25 @@ private function getDefinitionsFromArguments(array $arguments)
952
952
*
953
953
* @return Boolean
954
954
*/
955
- private function hasReference ($ id , array $ arguments , $ deep = false )
955
+ private function hasReference ($ id , array $ arguments , $ deep = false , $ visited = array () )
956
956
{
957
957
foreach ($ arguments as $ argument ) {
958
958
if (is_array ($ argument )) {
959
- if ($ this ->hasReference ($ id , $ argument , $ deep )) {
959
+ if ($ this ->hasReference ($ id , $ argument , $ deep, $ visited )) {
960
960
return true ;
961
961
}
962
962
} elseif ($ argument instanceof Reference) {
963
963
if ($ id === (string ) $ argument ) {
964
964
return true ;
965
965
}
966
966
967
- if ($ deep ) {
967
+ if ($ deep && !isset ($ visited [(string ) $ argument ])) {
968
+ $ visited [(string ) $ argument ] = true ;
969
+
968
970
$ service = $ this ->container ->getDefinition ((string ) $ argument );
969
971
$ arguments = array_merge ($ service ->getMethodCalls (), $ service ->getArguments (), $ service ->getProperties ());
970
972
971
- if ($ this ->hasReference ($ id , $ arguments , $ deep )) {
973
+ if ($ this ->hasReference ($ id , $ arguments , $ deep, $ visited )) {
972
974
return true ;
973
975
}
974
976
}
You can’t perform that action at this time.
0 commit comments