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