File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 55use Closure ;
66use Exception ;
77use Reliese \Component \Dependency \Container as ContainerComponent ;
8+ use Reliese \Component \Dependency \DependencyCaller ;
9+ use Reliese \Component \Dependency \DependencyLocator ;
10+ use Reliese \Component \Dependency \DependencyRegistrar ;
811use Reliese \Component \Dependency \Exceptions \UnresolvableDependencyException ;
912use ReflectionClass ;
1013use ReflectionException ;
@@ -22,6 +25,22 @@ class Container implements ContainerComponent
2225 */
2326 private $ singletons = [];
2427
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+
2544 /**
2645 * @param $dependency
2746 * @param Closure $abstraction
You can’t perform that action at this time.
0 commit comments