1 | <?php |
||
13 | class Container implements ArrayAccess, ContainerContract |
||
14 | { |
||
15 | /** |
||
16 | * The container's bindings. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $bindings = []; |
||
21 | |||
22 | /** |
||
23 | * Register a binding with the container. |
||
24 | * |
||
25 | * @param string $abstract |
||
26 | * @param mixed $concrete |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | public function bind($abstract, $concrete) |
||
34 | |||
35 | /** |
||
36 | * Register a service as a singleton. |
||
37 | * |
||
38 | * @param string $abstract |
||
39 | * @param mixed $concrete |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function singleton($abstract, $concrete) |
||
47 | |||
48 | /** |
||
49 | * Resolve the given type from the container. |
||
50 | * |
||
51 | * @param string $abstract |
||
52 | * |
||
53 | * @throws \InvalidArgumentException |
||
54 | * |
||
55 | * @return mixed |
||
56 | */ |
||
57 | public function make($abstract) |
||
67 | |||
68 | /** |
||
69 | * Determine if the given abstract type has been bound. |
||
70 | * |
||
71 | * @param string $abstract |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function bound($abstract) |
||
79 | |||
80 | /** |
||
81 | * Remove the specified abstract from the container. |
||
82 | * |
||
83 | * @param string $abstract |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | public function remove($abstract) |
||
91 | |||
92 | /** |
||
93 | * Returns a closure that stores the result of the given closure for |
||
94 | * uniqueness in the scope of this instance of the container. |
||
95 | * |
||
96 | * @param \Closure $callable |
||
97 | * |
||
98 | * @return \Closure |
||
99 | */ |
||
100 | public static function share(Closure $callable) |
||
112 | |||
113 | /** |
||
114 | * Protects a callable from being interpreted as a service. |
||
115 | * |
||
116 | * @param \Closure $callable |
||
117 | * |
||
118 | * @return \Closure |
||
119 | */ |
||
120 | public static function protect(Closure $callable) |
||
126 | |||
127 | /** |
||
128 | * Gets a parameter or the closure defining an object. |
||
129 | * |
||
130 | * @param string $abstract |
||
131 | * |
||
132 | * @throws \InvalidArgumentException |
||
133 | * |
||
134 | * @return mixed |
||
135 | */ |
||
136 | public function raw($abstract) |
||
144 | |||
145 | /** |
||
146 | * Extends an object definition. |
||
147 | * |
||
148 | * @param string $abstract |
||
149 | * @param \Closure $callable |
||
150 | * |
||
151 | * @throws \InvalidArgumentException |
||
152 | * |
||
153 | * @return \Closure |
||
154 | */ |
||
155 | public function extend($abstract, Closure $callable) |
||
171 | |||
172 | /** |
||
173 | * Returns all defined value names. |
||
174 | * |
||
175 | * @return array |
||
176 | */ |
||
177 | public function keys() |
||
181 | |||
182 | /** |
||
183 | * Register a binding with the container. |
||
184 | * |
||
185 | * @param string $abstract |
||
186 | * @param mixed $concrete |
||
187 | * |
||
188 | * @return void |
||
189 | */ |
||
190 | public function __set($abstract, $concrete) |
||
194 | |||
195 | /** |
||
196 | * Resolve the given type from the container. |
||
197 | * |
||
198 | * @param string $abstract |
||
199 | * |
||
200 | * @return mixed |
||
201 | */ |
||
202 | public function __get($abstract) |
||
206 | |||
207 | /** |
||
208 | * Determine if the given abstract type has been bound. |
||
209 | * |
||
210 | * @param string $abstract |
||
211 | * |
||
212 | * @return bool |
||
213 | */ |
||
214 | public function __isset($abstract) |
||
218 | |||
219 | /** |
||
220 | * Remove the specified abstract from the container. |
||
221 | * |
||
222 | * @param string $abstract |
||
223 | * |
||
224 | * @return void |
||
225 | */ |
||
226 | public function __unset($abstract) |
||
230 | |||
231 | /** |
||
232 | * Register a binding with the container. |
||
233 | * |
||
234 | * @param string $abstract |
||
235 | * @param mixed $concrete |
||
236 | * |
||
237 | * @return void |
||
238 | */ |
||
239 | public function offsetSet($abstract, $concrete) |
||
243 | |||
244 | /** |
||
245 | * Resolve the given type from the container. |
||
246 | * |
||
247 | * @param string $abstract |
||
248 | * |
||
249 | * @return mixed |
||
250 | */ |
||
251 | public function offsetGet($abstract) |
||
255 | |||
256 | /** |
||
257 | * Determine if the given abstract type has been bound. |
||
258 | * |
||
259 | * @param string $abstract |
||
260 | * |
||
261 | * @return bool |
||
262 | */ |
||
263 | public function offsetExists($abstract) |
||
267 | |||
268 | /** |
||
269 | * Remove the specified abstract from the container. |
||
270 | * |
||
271 | * @param string $abstract |
||
272 | * |
||
273 | * @return void |
||
274 | */ |
||
275 | public function offsetUnset($abstract) |
||
279 | } |
||
280 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.