| Total Complexity | 7 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait HasNames |
||
| 8 | { |
||
| 9 | 3 | public function name(): string |
|
| 10 | { |
||
| 11 | 3 | return trans("{$this->transFileName()}.{$this->transKey()}.{$this->value}"); |
|
| 12 | } |
||
| 13 | |||
| 14 | 4 | public function transFileName(): string |
|
| 17 | } |
||
| 18 | |||
| 19 | 4 | public function transKey(): string |
|
| 20 | { |
||
| 21 | 4 | return Str::snake(class_basename(static::class)); |
|
| 22 | } |
||
| 23 | |||
| 24 | 2 | public static function options(): array |
|
| 25 | { |
||
| 26 | 2 | $data = []; |
|
| 27 | 2 | foreach (static::cases() as $case) { |
|
| 28 | 2 | $data[$case->value] = $case->name(); |
|
| 29 | } |
||
| 30 | |||
| 31 | 2 | return $data; |
|
| 32 | } |
||
| 33 | |||
| 34 | 1 | public static function formattedOptions(): array |
|
| 45 | } |
||
| 46 | } |
||
| 47 |