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 | 8 | public function make($name) |
|
72 | |||
73 | /** |
||
74 | * @param $name |
||
75 | * |
||
76 | * @return mixed|object |
||
77 | * |
||
78 | * @throws ReflectionException |
||
79 | */ |
||
80 | 7 | protected function build($name) |
|
102 | |||
103 | /** |
||
104 | * @param ReflectionParameter[] $reflectionParameters |
||
105 | * |
||
106 | * @throws |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | 1 | protected function getDependencies(array $reflectionParameters) |
|
139 | |||
140 | /** |
||
141 | * @param $name |
||
142 | * |
||
143 | * @return string|Closure |
||
144 | */ |
||
145 | 7 | protected function getConcrete($name) |
|
157 | |||
158 | /** |
||
159 | * @param $name |
||
160 | * @param $instance |
||
161 | * |
||
162 | * @return mixed |
||
163 | */ |
||
164 | protected function saveInstanceIfShareable($name, $instance) |
||
172 | |||
173 | /** |
||
174 | * @param mixed $offset |
||
175 | * |
||
176 | * @return bool |
||
177 | */ |
||
178 | 2 | public function offsetExists($offset) |
|
182 | |||
183 | /** |
||
184 | * @param mixed $offset |
||
185 | * |
||
186 | * @throws ReflectionException |
||
187 | * |
||
188 | * @return mixed|object |
||
189 | */ |
||
190 | 1 | public function offsetGet($offset) |
|
194 | |||
195 | /** |
||
196 | * @param mixed $offset |
||
197 | * @param mixed $value |
||
198 | */ |
||
199 | 2 | public function offsetSet($offset, $value) |
|
203 | |||
204 | /** |
||
205 | * @param mixed $offset |
||
206 | */ |
||
207 | 1 | public function offsetUnset($offset) |
|
211 | } |
||
212 |