This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 16
16
use ProxyManager \Factory \LazyLoadingValueHolderFactory ;
17
17
use ProxyManager \GeneratorStrategy \EvaluatingGeneratorStrategy ;
18
18
use Zend \ServiceManager \Exception \ContainerModificationsNotAllowedException ;
19
+ use Zend \ServiceManager \Exception \CyclicAliasException ;
19
20
use Zend \ServiceManager \Exception \InvalidArgumentException ;
20
21
use Zend \ServiceManager \Exception \InvalidServiceException ;
21
22
use Zend \ServiceManager \Exception \ServiceNotCreatedException ;
@@ -575,7 +576,7 @@ private function resolveAliases(array $aliases)
575
576
576
577
while (isset ($ this ->aliases [$ name ])) {
577
578
if (isset ($ visited [$ name ])) {
578
- throw new InvalidServiceException ( ' YADDA ' );
579
+ throw CyclicAliasException:: fromAliasesMap ( $ aliases );
579
580
}
580
581
581
582
$ visited [$ name ] = true ;
Original file line number Diff line number Diff line change 15
15
use ReflectionProperty ;
16
16
use stdClass ;
17
17
use Zend \ServiceManager \Exception \ContainerModificationsNotAllowedException ;
18
+ use Zend \ServiceManager \Exception \CyclicAliasException ;
18
19
use Zend \ServiceManager \Exception \InvalidArgumentException ;
19
20
use Zend \ServiceManager \Exception \InvalidServiceException ;
20
21
use Zend \ServiceManager \Exception \ServiceNotCreatedException ;
@@ -791,15 +792,13 @@ public function testCanRetrieveParentContainerViaGetServiceLocatorWithDeprecatio
791
792
*/
792
793
public function testCrashesOnCyclicAliases ()
793
794
{
794
- $ this ->setExpectedException (InvalidServiceException ::class);
795
+ $ this ->setExpectedException (CyclicAliasException ::class);
795
796
796
- $ serviceManager = $ this ->createContainer ([
797
+ $ this ->createContainer ([
797
798
'aliases ' => [
798
799
'a ' => 'b ' ,
799
800
'b ' => 'a ' ,
800
801
],
801
802
]);
802
-
803
- $ serviceManager ->get ('b ' );
804
803
}
805
804
}
You can’t perform that action at this time.
0 commit comments