Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.072 |
Changes | 0 |
1 | <?php |
||
25 | 5 | public static function wrap($handler): RequestHandlerInterface |
|
26 | { |
||
27 | 5 | if ($handler instanceof RequestHandlerInterface) { |
|
28 | return $handler; |
||
29 | } |
||
30 | 5 | if (is_callable($handler)) { |
|
31 | 5 | return new self($handler); |
|
32 | } |
||
33 | |||
34 | // @codeCoverageIgnoreStart |
||
35 | throw new \InvalidArgumentException('$handler must be a valid handler'); |
||
36 | // @codeCoverageIgnoreEnd |
||
44 |