@@ -257,7 +257,8 @@ discard block |
||
257 | 257 | list($class, $param, $sub) = $pi; |
258 | 258 | |
259 | 259 | // First, loop through $args and see if each value can match the current parameter based on type hint |
260 | - if (!empty($args)) { // This if statement actually gives a ~10% speed increase when $args isn't set |
|
260 | + if (!empty($args)) { |
|
261 | +// This if statement actually gives a ~10% speed increase when $args isn't set |
|
261 | 262 | foreach ($args as $i => $arg) { |
262 | 263 | if ($class !== null |
263 | 264 | && ($arg instanceof $class || ($arg === null && $param->allowsNull())) |
@@ -275,8 +276,7 @@ discard block |
||
275 | 276 | $parameters[] = ($sub) |
276 | 277 | ? $this->expand($rule['substitutions'][$class], $share, true) |
277 | 278 | : $this->create($class, [], $share); |
278 | - } |
|
279 | - catch (\InvalidArgumentException $e) { |
|
279 | + } catch (\InvalidArgumentException $e) { |
|
280 | 280 | |
281 | 281 | } |
282 | 282 | continue; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | class Dice |
17 | 17 | { |
18 | 18 | const CONSTANT = 'Dice::CONSTANT'; |
19 | - const INSTANCE = 'Dice::INSTANCE'; |
|
19 | + const INSTANCE = 'Dice::INSTANCE'; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @var array $rules Rules which have been set using addRule() |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | |
64 | 64 | // Allow substitutions rules to be defined with a leading a slash |
65 | 65 | if (isset($rule['substitutions'])) { |
66 | - foreach($rule['substitutions'] as $key => $value) { |
|
67 | - $rule[ltrim($key, '\\')] = $value; |
|
66 | + foreach ($rule['substitutions'] as $key => $value) { |
|
67 | + $rule[ltrim($key, '\\')] = $value; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | $this->rules[self::normalizeName($classname)] = \array_replace_recursive($this->getRule($classname), $rule); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | //If there are shared instances, create them and merge them with shared instances higher up the object graph |
172 | 172 | if (isset($rule['shareInstances'])) { |
173 | 173 | $closure = function(array $args, array $share) use ($closure, $rule) { |
174 | - foreach($rule['shareInstances'] as $instance) { |
|
174 | + foreach ($rule['shareInstances'] as $instance) { |
|
175 | 175 | $share[] = $this->create($instance, [], $share); |
176 | 176 | } |
177 | 177 | return $closure($args, $share); |