| Total Complexity | 3 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class InvalidShortCodeException extends RuntimeException |
||
| 12 | { |
||
| 13 | 2 | public static function fromCharset(string $shortCode, string $charSet, ?Throwable $previous = null): self |
|
| 14 | { |
||
| 15 | 2 | $code = $previous !== null ? $previous->getCode() : -1; |
|
| 16 | 2 | return new static( |
|
| 17 | 2 | sprintf('Provided short code "%s" does not match the char set "%s"', $shortCode, $charSet), |
|
| 18 | 2 | $code, |
|
| 19 | 2 | $previous |
|
| 20 | ); |
||
| 21 | } |
||
| 22 | |||
| 23 | 2 | public static function fromNotFoundShortCode(string $shortCode): self |
|
| 26 | } |
||
| 27 | } |
||
| 28 |