Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 8 | public static function __callStatic(string $name, array $arguments): MiddlewareInterface |
|
32 | { |
||
33 | 8 | if (! array_key_exists(0, $arguments) || ! $arguments[0] instanceof ContainerInterface) { |
|
34 | 4 | throw new InvalidArgumentException(sprintf( |
|
35 | 4 | 'The first argument must be of type %s', |
|
36 | 4 | ContainerInterface::class |
|
37 | )); |
||
38 | } |
||
39 | |||
40 | 4 | return (new static($name))($arguments[0]); |
|
41 | } |
||
43 |