This repository has been archived by the owner on Feb 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'SocalNick/hotfix/abstract-di-factory-ci…
…rcular-dependency'
- Loading branch information
43 parents
a2a09ca
+
5b64ee3
+
9456811
+
1c2d797
+
46b0d8f
+
82264b3
+
39c88ce
+
cee064b
+
c303bed
+
ea247e3
+
1f87514
+
8896fc2
+
313a38d
+
42848d4
+
8f5c457
+
e035a2a
+
544e341
+
467f8b2
+
30bb6f0
+
f8cc896
+
2ee0afd
+
656f0b0
+
7092cb4
+
5e1b259
+
abb3ff8
+
39a873f
+
b6e6c92
+
83055d8
+
1dd5d72
+
9bc304a
+
479b8c7
+
41fab24
+
80aee85
+
3962f1e
+
6c6b004
+
acb7af7
+
39aca71
+
9d55623
+
c2210f2
+
50b7a31
+
327d366
+
04ff83b
+
13c830b
commit 32f4be5
Showing
4 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
|
||
namespace ZendTest\ServiceManager\TestAsset; | ||
|
||
use Zend\ServiceManager\AbstractFactoryInterface, | ||
Zend\ServiceManager\ServiceLocatorInterface; | ||
|
||
/** | ||
* Class used to try to simulate a cyclic dependency in ServiceManager. | ||
*/ | ||
class CircularDependencyAbstractFactory implements AbstractFactoryInterface | ||
{ | ||
public $expectedInstance = 'a retrieved value'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) | ||
{ | ||
if ($serviceLocator->has($name)) { | ||
return $serviceLocator->get($name); | ||
} | ||
|
||
return $this->expectedInstance; | ||
} | ||
} |