| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public static function throwable($exception) |
||
| 16 | { |
||
| 17 | // PHP >= 7.0 |
||
| 18 | if (true === interface_exists('\Throwable') && is_subclass_of($exception, '\Throwable')) { |
||
| 19 | return; |
||
| 20 | } |
||
| 21 | |||
| 22 | // PHP < 7.0 |
||
| 23 | if ($exception instanceof \Exception) { |
||
| 24 | return; |
||
| 25 | } |
||
| 26 | |||
| 27 | throw new \InvalidArgumentException('An object of type \Throwable or \Exception is required.'); |
||
| 28 | } |
||
| 30 |