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