Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public static function __(int $enum) |
||
18 | { |
||
19 | $callClass = get_called_class(); |
||
20 | $module = strtolower(Str::before(Str::after($callClass, 'Modules\\'), '\\')); |
||
21 | $scope = Str::camel(Str::before(Str::after($callClass, 'Enums\\'), 'Enum')); |
||
22 | |||
23 | if (!Arr::has(static::__, $enum)) { |
||
24 | return __('core::default.translator_key_is_not_found'); |
||
25 | } |
||
26 | |||
27 | $key = static::__[$enum]; |
||
28 | |||
29 | return __("{$module}::{$scope}.{$key}"); |
||
30 | } |
||
32 |