@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | if ($constructor = $inspector->getConstructor()) { |
135 | 135 | $dependencies = $constructor->getParameters(); |
136 | 136 | |
137 | - return function ($abstract, $parameters) use ($inspector, $dependencies, $force) { |
|
137 | + return function($abstract, $parameters) use ($inspector, $dependencies, $force) { |
|
138 | 138 | $resolvedClassParameters = []; |
139 | 139 | |
140 | 140 | foreach ($dependencies as $dependency) { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | }; |
148 | 148 | } |
149 | 149 | |
150 | - return function ($abstract) { |
|
150 | + return function($abstract) { |
|
151 | 151 | return new $abstract; |
152 | 152 | }; |
153 | 153 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | $key = $abstract.$dependency->name; |
168 | 168 | |
169 | - if (! isset($this->resolved[$key]) || $force === true) { |
|
169 | + if (!isset($this->resolved[$key]) || $force === true) { |
|
170 | 170 | $this->resolved[$key] = $this->generate($abstract, $dependency); |
171 | 171 | } |
172 | 172 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | return $this->dependencies[$key]; |
193 | 193 | } |
194 | 194 | |
195 | - return function () use ($classname) { |
|
195 | + return function() use ($classname) { |
|
196 | 196 | return $this->make($classname); |
197 | 197 | }; |
198 | 198 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function get($abstract) |
228 | 228 | { |
229 | - if (! isset($this->collection[$abstract])) { |
|
229 | + if (!isset($this->collection[$abstract])) { |
|
230 | 230 | throw new Exceptions\NotFoundException("Element '$abstract' not found"); |
231 | 231 | } |
232 | 232 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | public function set(string $abstract, $concrete, bool $shared = false) : self |
284 | 284 | { |
285 | 285 | if ($concrete instanceof Closure === false) { |
286 | - $concrete = function (Container $container) use ($concrete) { |
|
286 | + $concrete = function(Container $container) use ($concrete) { |
|
287 | 287 | return $container->make($concrete); |
288 | 288 | }; |
289 | 289 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | |
308 | 308 | public function setIf(string $abstract, $concrete, bool $shared = false) : self |
309 | 309 | { |
310 | - if (! isset($this->collection[$abstract])) { |
|
310 | + if (!isset($this->collection[$abstract])) { |
|
311 | 311 | $this->set($abstract, $concrete, $shared); |
312 | 312 | } |
313 | 313 | |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | { |
329 | 329 | if ($dependency instanceof Closure === false) { |
330 | 330 | if (is_object($dependency)) { |
331 | - $dependency = function () use ($dependency) { |
|
331 | + $dependency = function() use ($dependency) { |
|
332 | 332 | return $dependency; |
333 | 333 | }; |
334 | 334 | } else { |
335 | - $dependency = function () use ($dependency) { |
|
335 | + $dependency = function() use ($dependency) { |
|
336 | 336 | return $this->get($dependency); |
337 | 337 | }; |
338 | 338 | } |
@@ -372,8 +372,8 @@ discard block |
||
372 | 372 | |
373 | 373 | public function instance(string $abstract, $instance) : self |
374 | 374 | { |
375 | - if (! is_object($instance)) { |
|
376 | - throw new Exceptions\ContainerException('Trying to store ' . gettype($type) . ' as object.'); |
|
375 | + if (!is_object($instance)) { |
|
376 | + throw new Exceptions\ContainerException('Trying to store '.gettype($type).' as object.'); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | $this->collection[$abstract] = $instance; |
@@ -393,14 +393,14 @@ discard block |
||
393 | 393 | |
394 | 394 | public function extend(string $abstract, closure $extension) : self |
395 | 395 | { |
396 | - if (! isset($this->collection[$abstract])) { |
|
396 | + if (!isset($this->collection[$abstract])) { |
|
397 | 397 | throw new Exceptions\NotFoundException; |
398 | 398 | } |
399 | 399 | |
400 | 400 | $object = $this->collection[$abstract]; |
401 | 401 | |
402 | 402 | if ($object instanceof Closure) { |
403 | - $this->collection[$abstract] = function () use ($object, $extension) { |
|
403 | + $this->collection[$abstract] = function() use ($object, $extension) { |
|
404 | 404 | return $extension($object($this), $this); |
405 | 405 | }; |
406 | 406 | } else { |
@@ -423,11 +423,11 @@ discard block |
||
423 | 423 | |
424 | 424 | public function share(string $abstract) : self |
425 | 425 | { |
426 | - if (! isset($this->collection[$abstract])) { |
|
426 | + if (!isset($this->collection[$abstract])) { |
|
427 | 427 | throw new Exceptions\NotFoundException("Element '$abstract' not found"); |
428 | 428 | } |
429 | 429 | |
430 | - if (! $this->collection[$abstract] instanceof Closure) { |
|
430 | + if (!$this->collection[$abstract] instanceof Closure) { |
|
431 | 431 | throw new Exceptions\ContainerException("'$abstract' must be a resolvable element"); |
432 | 432 | } |
433 | 433 |