Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1eab515

Browse filesBrowse files
committed
merged branch fabpot/container-dumper-fix (PR #6959)
This PR was submitted for the 2.2 branch but it was merged into the 2.0 branch instead (closes #6959). Commits ------- ad889c9 [DependencyInjection] fixed a circular call (closes #6864) Discussion ---------- [DependencyInjection] fixed a circular call (closes #6864) | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #6864 | License | MIT | Doc PR | n/a
2 parents 115114b + 74f2fcf commit 1eab515
Copy full SHA for 1eab515

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -952,23 +952,25 @@ private function getDefinitionsFromArguments(array $arguments)
952952
*
953953
* @return Boolean
954954
*/
955-
private function hasReference($id, array $arguments, $deep = false)
955+
private function hasReference($id, array $arguments, $deep = false, $visited = array())
956956
{
957957
foreach ($arguments as $argument) {
958958
if (is_array($argument)) {
959-
if ($this->hasReference($id, $argument, $deep)) {
959+
if ($this->hasReference($id, $argument, $deep, $visited)) {
960960
return true;
961961
}
962962
} elseif ($argument instanceof Reference) {
963963
if ($id === (string) $argument) {
964964
return true;
965965
}
966966

967-
if ($deep) {
967+
if ($deep && !isset($visited[(string) $argument])) {
968+
$visited[(string) $argument] = true;
969+
968970
$service = $this->container->getDefinition((string) $argument);
969971
$arguments = array_merge($service->getMethodCalls(), $service->getArguments(), $service->getProperties());
970972

971-
if ($this->hasReference($id, $arguments, $deep)) {
973+
if ($this->hasReference($id, $arguments, $deep, $visited)) {
972974
return true;
973975
}
974976
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.