Total Complexity | 3 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
12 | final class UnsupportedResponseTypeException extends RuntimeException |
||
13 | { |
||
14 | 4 | public static function fromType(mixed $var): self |
|
15 | { |
||
16 | 4 | $type = self::inferType($var); |
|
17 | |||
18 | 4 | return new self("Unsupported response type '{$type}'. Must be a string or implement Stringable interface."); |
|
19 | } |
||
20 | |||
21 | 4 | private static function inferType(mixed $var): string |
|
31 | } |
||
32 | } |
||
33 |