This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -859,6 +859,12 @@ private function validateServiceNames(array $config)
859
859
860
860
/**
861
861
* Assuming that the alias name is valid (see above) resolve/add it.
862
+ *
863
+ * This is done differently from bulk mapping aliases for performance reasons, as the
864
+ * algorithms for mapping a single item efficiently are different from those of mapping
865
+ * many.
866
+ *
867
+ * @see mapAliasesToTargets() below
862
868
*
863
869
* @param string $alias
864
870
* @param string $target
@@ -888,13 +894,12 @@ private function mapAliasToTarget($alias, $target)
888
894
/**
889
895
* Assuming that all provided alias keys are valid resolve them.
890
896
*
891
- * This as an adaptation of Tarjan's strongly connected components
892
- * algorithm. We detect cycles as well reduce the graph so that
893
- * each alias key gets associated with the resolved service.
894
897
* This function maps $this->aliases in place.
895
898
*
896
899
* This algorithm is fast for mass updates through configure().
897
900
* It is not appropriate if just a single alias is added.
901
+ *
902
+ * @see mapAliasToTarget above
898
903
*
899
904
*/
900
905
private function mapAliasesToTargets ()
@@ -906,7 +911,6 @@ private function mapAliasesToTargets()
906
911
}
907
912
$ tCursor = $ this ->aliases [$ alias ];
908
913
$ aCursor = $ alias ;
909
- $ stack = [];
910
914
while (isset ($ this ->aliases [$ tCursor ])) {
911
915
$ tagged [$ aCursor ] = true ;
912
916
$ this ->aliases [$ aCursor ] = $ this ->aliases [$ tCursor ];
You can’t perform that action at this time.
0 commit comments