1 | <?php |
||
18 | class Container implements ArrayAccess |
||
19 | { |
||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $bindings = []; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $instances = []; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $shares = []; |
||
34 | |||
35 | /** |
||
36 | * @param $name |
||
37 | * @param null $concrete |
||
38 | * @param bool $share |
||
39 | */ |
||
40 | 8 | public function bind($name, $concrete = null, $share = false) |
|
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | * |
||
54 | * @throws ReflectionException |
||
55 | * |
||
56 | * @return object |
||
57 | */ |
||
58 | 12 | public function make($name) |
|
72 | |||
73 | /** |
||
74 | * @param $name |
||
75 | * @param $instance |
||
76 | */ |
||
77 | public function instance($name, $instance) |
||
81 | |||
82 | /** |
||
83 | * @param $name |
||
84 | * |
||
85 | * @throws ReflectionException |
||
86 | * |
||
87 | * @return mixed|object |
||
88 | */ |
||
89 | 11 | protected function build($name) |
|
111 | |||
112 | /** |
||
113 | * @param ReflectionParameter[] $reflectionParameters |
||
114 | * |
||
115 | * @throws |
||
116 | * |
||
117 | * @return array |
||
118 | */ |
||
119 | 3 | protected function getDependencies(array $reflectionParameters) |
|
148 | |||
149 | /** |
||
150 | * @param $name |
||
151 | * |
||
152 | * @return string|Closure |
||
153 | */ |
||
154 | 11 | protected function getConcrete($name) |
|
166 | |||
167 | /** |
||
168 | * @param mixed $offset |
||
169 | * |
||
170 | * @return bool |
||
171 | */ |
||
172 | 2 | public function offsetExists($offset) |
|
176 | |||
177 | /** |
||
178 | * @param mixed $offset |
||
179 | * |
||
180 | * @throws ReflectionException |
||
181 | * |
||
182 | * @return mixed|object |
||
183 | */ |
||
184 | 1 | public function offsetGet($offset) |
|
188 | |||
189 | /** |
||
190 | * @param mixed $offset |
||
191 | * @param mixed $value |
||
192 | */ |
||
193 | 2 | public function offsetSet($offset, $value) |
|
197 | |||
198 | /** |
||
199 | * @param mixed $offset |
||
200 | */ |
||
201 | 1 | public function offsetUnset($offset) |
|
205 | } |
||
206 |