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 @@ -955,23 +955,25 @@ private function getDefinitionsFromArguments(array $arguments)
955
955
*
956
956
* @return Boolean
957
957
*/
958
- private function hasReference ($ id , array $ arguments , $ deep = false )
958
+ private function hasReference ($ id , array $ arguments , $ deep = false , $ visited = array () )
959
959
{
960
960
foreach ($ arguments as $ argument ) {
961
961
if (is_array ($ argument )) {
962
- if ($ this ->hasReference ($ id , $ argument , $ deep )) {
962
+ if ($ this ->hasReference ($ id , $ argument , $ deep, $ visited )) {
963
963
return true ;
964
964
}
965
965
} elseif ($ argument instanceof Reference) {
966
966
if ($ id === (string ) $ argument ) {
967
967
return true ;
968
968
}
969
969
970
- if ($ deep ) {
970
+ if ($ deep && !isset ($ visited [(string ) $ argument ])) {
971
+ $ visited [(string ) $ argument ] = true ;
972
+
971
973
$ service = $ this ->container ->getDefinition ((string ) $ argument );
972
974
$ arguments = array_merge ($ service ->getMethodCalls (), $ service ->getArguments (), $ service ->getProperties ());
973
975
974
- if ($ this ->hasReference ($ id , $ arguments , $ deep )) {
976
+ if ($ this ->hasReference ($ id , $ arguments , $ deep, $ visited )) {
975
977
return true ;
976
978
}
977
979
}
You can’t perform that action at this time.
0 commit comments