Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 886b6f9

Browse files
author
fhein
committed
Switched mapAliasesToTargets from isset() to empty() mechanics.
1 parent a359426 commit 886b6f9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/ServiceManager.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,8 @@ private function mapAliasesToTargets()
897897
continue;
898898
}
899899

900+
$stack = [];
901+
900902
while (isset($this->aliases[$tCursor])) {
901903
$stack[] = $aCursor;
902904
if ($aCursor === $this->aliases[$tCursor]) {
@@ -908,19 +910,13 @@ private function mapAliasesToTargets()
908910

909911
$tagged[$aCursor] = true;
910912

911-
if (! isset($stack)) {
912-
continue;
913-
}
914-
915913
foreach ($stack as $alias) {
916914
if ($alias === $tCursor) {
917915
throw CyclicAliasException::fromCyclicAlias($alias, $this->aliases);
918916
}
919917
$this->aliases[$alias] = $tCursor;
920918
$tagged[$alias] = true;
921919
}
922-
923-
unset($stack);
924920
}
925921
}
926922

0 commit comments

Comments
 (0)