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