| Total Complexity | 3 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | trait LangTrait |
||
| 16 | { |
||
| 17 | /** @var string */ |
||
| 18 | // private static string $lang_regex = '/^(i[-]|x[-])?([a-z]{1,8})([-][a-z]{1,8})?$/Di'; |
||
| 19 | private static string $lang_regex = '/^([a-z]{2}|[i]-[a-z]+|[x]-[a-z]{1,8})(-[a-z]{1,8})*$/Di'; |
||
| 20 | |||
| 21 | /*********************************************************************************** |
||
| 22 | * NOTE: Custom assertions may be added below this line. * |
||
| 23 | * They SHOULD be marked as `protected` to ensure the call is forced * |
||
| 24 | * through __callStatic(). * |
||
| 25 | * Assertions marked `public` are called directly and will * |
||
| 26 | * not handle any custom exception passed to it. * |
||
| 27 | ***********************************************************************************/ |
||
| 28 | |||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $value |
||
| 32 | * @param string $message |
||
| 33 | */ |
||
| 34 | protected static function validLang(string $value, string $message = ''): void |
||
| 44 |