File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 5
5
use Closure ;
6
6
use Exception ;
7
7
use Reliese \Component \Dependency \Container as ContainerComponent ;
8
+ use Reliese \Component \Dependency \DependencyCaller ;
9
+ use Reliese \Component \Dependency \DependencyLocator ;
10
+ use Reliese \Component \Dependency \DependencyRegistrar ;
8
11
use Reliese \Component \Dependency \Exceptions \UnresolvableDependencyException ;
9
12
use ReflectionClass ;
10
13
use ReflectionException ;
@@ -22,6 +25,22 @@ class Container implements ContainerComponent
22
25
*/
23
26
private $ singletons = [];
24
27
28
+ /**
29
+ * Container constructor.
30
+ */
31
+ public function __construct ()
32
+ {
33
+ $ self = function () {
34
+ return $ this ;
35
+ };
36
+
37
+ $ this ->singleton (static ::class, $ self );
38
+ $ this ->singleton (ContainerComponent::class, $ self );
39
+ $ this ->singleton (DependencyRegistrar::class, $ self );
40
+ $ this ->singleton (DependencyLocator::class, $ self );
41
+ $ this ->singleton (DependencyCaller::class, $ self );
42
+ }
43
+
25
44
/**
26
45
* @param $dependency
27
46
* @param Closure $abstraction
You can’t perform that action at this time.
0 commit comments