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