| 1 | <?php | ||
| 4 | class DestinationException extends \RuntimeException implements SeoExceptionInterface | ||
| 5 | { | ||
| 6 | 7 | public static function normalizationFailed($item, $expected = null) | |
| 7 |     { | ||
| 8 | 7 | $message = sprintf( | |
| 9 | 7 | 'Cannot get slug for item of type %s.', | |
| 10 | 7 | is_object($item) ? get_class($item) : gettype($item) | |
| 11 | 7 | ); | |
| 12 | 7 |         if ($expected) { | |
| 13 | 6 |             $message .= sprintf(' Item of type %s expected.', $expected); | |
| 14 | 6 | } | |
| 15 | |||
| 16 | 7 | return new static($message); | |
| 17 | } | ||
| 18 | |||
| 19 | 1 | public static function inferenceFailed($code, array $item, array $fillers) | |
| 20 |     { | ||
| 21 | 1 | return new static( | |
| 22 | 1 | sprintf( | |
| 23 | 1 | 'Unable to infer item code %s from %s (known fillers are %s)', | |
| 24 | 1 | $code, | |
| 25 | 1 |                 implode(',', array_keys($item)), | |
| 26 | 1 |                 implode(',', array_keys($fillers)) | |
| 27 | 1 | ) | |
| 28 | 1 | ); | |
| 29 | } | ||
| 30 | |||
| 31 | 1 | public static function circularInference($code, $visited) | |
| 35 | } | ||
| 36 |