| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class LanguageDoesNotExist extends InvalidArgumentException |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Creates an exception with an error message based on the language name or locale. |
||
| 21 | * |
||
| 22 | * @param string $languageName the language name or locale |
||
| 23 | * |
||
| 24 | * @return static |
||
| 25 | */ |
||
| 26 | public static function create(string $languageName) |
||
| 27 | { |
||
| 28 | return new static("There is no language named `{$languageName}`."); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Creates an exception with an error message based on the language ID. |
||
| 33 | * |
||
| 34 | * @param int $languageId the language ID which does not exist in the database |
||
| 35 | * |
||
| 36 | * @return static |
||
| 37 | */ |
||
| 38 | public static function withId(int $languageId) |
||
| 41 | } |
||
| 42 | } |
||
| 43 |