@@ -305,9 +305,9 @@ |
||
| 305 | 305 | |
| 306 | 306 | $args[$param_name] = $this->findParentService($name, $type_class, $config, $parents); |
| 307 | 307 | } elseif($param->isDefaultValueAvailable()) { |
| 308 | - $args[$param_name] = $param->getDefaultValue(); |
|
| 308 | + $args[$param_name] = $param->getDefaultValue(); |
|
| 309 | 309 | } elseif($param->allowsNull() && $param->hasType()) { |
| 310 | - $args[$param_name] = null; |
|
| 310 | + $args[$param_name] = null; |
|
| 311 | 311 | } else { |
| 312 | 312 | throw new Exception\Configuration('no value found for argument '.$param_name.' in method '.$method->getName().' for service '.$name); |
| 313 | 313 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Balloon |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | return $this->service[$name]['instance']; |
| 66 | 66 | } |
| 67 | 67 | if (isset($this->registry[$name])) { |
| 68 | - if( $this->registry[$name] instanceof Closure) { |
|
| 68 | + if ($this->registry[$name] instanceof Closure) { |
|
| 69 | 69 | $this->service[$name]['instance'] = $this->registry[$name]->call($this); |
| 70 | 70 | } else { |
| 71 | 71 | $this->service[$name]['instance'] = $this->registry[$name]; |
@@ -84,18 +84,18 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @return array |
| 86 | 86 | */ |
| 87 | - public function __debug(?array $container=null): array |
|
| 87 | + public function __debug(?array $container = null): array |
|
| 88 | 88 | { |
| 89 | - if($container === null) { |
|
| 89 | + if ($container === null) { |
|
| 90 | 90 | $container = $this->service; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - foreach($container as $name => &$service) { |
|
| 94 | - if(isset($service['instance'])) { |
|
| 93 | + foreach ($container as $name => &$service) { |
|
| 94 | + if (isset($service['instance'])) { |
|
| 95 | 95 | $service['instance'] = 'instanceof '.get_class($service['instance']); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if(isset($service['services'])) { |
|
| 98 | + if (isset($service['services'])) { |
|
| 99 | 99 | $service['services'] = $this->__debug($service['services']); |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -259,12 +259,12 @@ discard block |
||
| 259 | 259 | $parents[$name] = $config; |
| 260 | 260 | $parents_orig = $parents; |
| 261 | 261 | |
| 262 | - if(isset($config['calls'])) { |
|
| 263 | - foreach($config['calls'] as $call) { |
|
| 262 | + if (isset($config['calls'])) { |
|
| 263 | + foreach ($config['calls'] as $call) { |
|
| 264 | 264 | $arguments = []; |
| 265 | 265 | try { |
| 266 | 266 | $method = $class->getMethod($call['method']); |
| 267 | - } catch(\ReflectionException $e) { |
|
| 267 | + } catch (\ReflectionException $e) { |
|
| 268 | 268 | throw new Exception\Configuration('method '.$call['method'].' is not callable in class '.$class->getName().' for service '.$name); |
| 269 | 269 | } |
| 270 | 270 | |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | $type = $param->getClass(); |
| 295 | 295 | $param_name = $param->getName(); |
| 296 | 296 | |
| 297 | - if(isset($config['arguments'][$param_name])) { |
|
| 297 | + if (isset($config['arguments'][$param_name])) { |
|
| 298 | 298 | $args[$param_name] = $this->parseParam($config['arguments'][$param_name], $name, $type, $config, $parents); |
| 299 | - } elseif($type !== null) { |
|
| 299 | + } elseif ($type !== null) { |
|
| 300 | 300 | $type_class = $type->getName(); |
| 301 | 301 | |
| 302 | 302 | if ($type_class === $name) { |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | $args[$param_name] = $this->findParentService($name, $type_class, $config, $parents); |
| 307 | - } elseif($param->isDefaultValueAvailable()) { |
|
| 307 | + } elseif ($param->isDefaultValueAvailable()) { |
|
| 308 | 308 | $args[$param_name] = $param->getDefaultValue(); |
| 309 | - } elseif($param->allowsNull() && $param->hasType()) { |
|
| 309 | + } elseif ($param->allowsNull() && $param->hasType()) { |
|
| 310 | 310 | $args[$param_name] = null; |
| 311 | 311 | } else { |
| 312 | 312 | throw new Exception\Configuration('no value found for argument '.$param_name.' in method '.$method->getName().' for service '.$name); |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | return str_replace($match[0], $env, $param); |
| 355 | - } elseif(preg_match('#^\{(.*)\}$#', $param, $match)) { |
|
| 355 | + } elseif (preg_match('#^\{(.*)\}$#', $param, $match)) { |
|
| 356 | 356 | return $this->findParentService($match[1], $match[1], $config, $parents); |
| 357 | 357 | } |
| 358 | 358 | |