| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 5 | public static function fromNotFoundShortCode(string $shortCode, ?string $domain = null): self |
|
| 21 | { |
||
| 22 | 5 | $suffix = $domain === null ? '' : sprintf(' for domain "%s"', $domain); |
|
| 23 | 5 | $e = new self(sprintf('No URL found with short code "%s"%s', $shortCode, $suffix)); |
|
| 24 | |||
| 25 | 5 | $e->detail = $e->getMessage(); |
|
| 26 | 5 | $e->title = self::TITLE; |
|
| 27 | 5 | $e->type = self::TYPE; |
|
| 28 | 5 | $e->status = StatusCodeInterface::STATUS_NOT_FOUND; |
|
| 29 | 5 | $e->additional = ['shortCode' => $shortCode]; |
|
| 30 | |||
| 31 | 5 | if ($domain !== null) { |
|
| 32 | 1 | $e->additional['domain'] = $domain; |
|
| 33 | } |
||
| 34 | |||
| 35 | 5 | return $e; |
|
| 36 | } |
||
| 38 |