@@ -49,8 +49,7 @@ |
||
49 | 49 | |
50 | 50 | use Platine\Container\ContainerInterface; |
51 | 51 | |
52 | -interface ParameterInterface |
|
53 | -{ |
|
52 | +interface ParameterInterface { |
|
54 | 53 | |
55 | 54 | /** |
56 | 55 | * Return the name of the parameter |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function __construct() |
92 | 92 | { |
93 | - $this->resolver = new ConstructorResolver(); |
|
94 | - $this->storages = new StorageCollection(); |
|
93 | + $this->resolver = new ConstructorResolver(); |
|
94 | + $this->storages = new StorageCollection(); |
|
95 | 95 | self::$instance = $this; |
96 | 96 | } |
97 | 97 | |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | if (is_callable($type)) { |
307 | 307 | return Closure::fromCallable($type); |
308 | 308 | } elseif (!is_string($type)) { |
309 | - return function () use ($type) { |
|
309 | + return function() use ($type) { |
|
310 | 310 | return $type; |
311 | 311 | }; |
312 | 312 | } |
313 | 313 | |
314 | - return function ($container, $parameters) use ($type) { |
|
314 | + return function($container, $parameters) use ($type) { |
|
315 | 315 | return $container |
316 | 316 | ->getResolver() |
317 | 317 | ->resolve($container, $type, $parameters); |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | use Platine\Container\Exception\ContainerException; |
53 | 53 | use Platine\Container\Exception\NotFoundException; |
54 | 54 | |
55 | -class Container implements ContainerInterface |
|
56 | -{ |
|
55 | +class Container implements ContainerInterface { |
|
57 | 56 | |
58 | 57 | /** |
59 | 58 | * The container global instance |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | /** |
89 | 88 | * Create new container instance |
90 | 89 | */ |
91 | - public function __construct() |
|
92 | - { |
|
90 | + public function __construct() { |
|
93 | 91 | $this->resolver = new ConstructorResolver(); |
94 | 92 | $this->storages = new StorageCollection(); |
95 | 93 | self::$instance = $this; |
@@ -136,8 +134,7 @@ discard block |
||
136 | 134 | * Remove all lock when copy this object |
137 | 135 | * @return void |
138 | 136 | */ |
139 | - public function __clone() |
|
140 | - { |
|
137 | + public function __clone() { |
|
141 | 138 | $this->lock = []; |
142 | 139 | } |
143 | 140 | |
@@ -252,8 +249,7 @@ discard block |
||
252 | 249 | * @param array<string, mixed> $parameters |
253 | 250 | * @return mixed |
254 | 251 | */ |
255 | - public function make(string $id, array $parameters = []) |
|
256 | - { |
|
252 | + public function make(string $id, array $parameters = []) { |
|
257 | 253 | if (isset($this->lock[$id])) { |
258 | 254 | throw new ContainerException(sprintf( |
259 | 255 | 'Detected a cyclic dependency while provisioning [%s]', |
@@ -287,8 +283,7 @@ discard block |
||
287 | 283 | /** |
288 | 284 | * {@inheritdoc} |
289 | 285 | */ |
290 | - public function get(string $id) |
|
291 | - { |
|
286 | + public function get(string $id) { |
|
292 | 287 | if (!$this->has($id)) { |
293 | 288 | throw new NotFoundException(sprintf('The type/class [%s] does not exist in the container!', $id)); |
294 | 289 | } |