Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait LocalePathsTrait |
||
10 | { |
||
11 | use HelpersTrait; |
||
12 | |||
13 | /** |
||
14 | * Get a locales path for an entity. |
||
15 | * |
||
16 | * @return string |
||
17 | */ |
||
18 | protected function getLocalePath(): string |
||
19 | { |
||
20 | if (isset($this->locale_path) && is_string($this->locale_path)) { |
||
21 | return $this->locale_path; |
||
22 | } |
||
23 | |||
24 | return $this->generateLocalePath(); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Generate a locales path by the current class name. |
||
29 | * |
||
30 | * @throws \Exception |
||
31 | * @return string |
||
32 | */ |
||
33 | protected function generateLocalePath(): string |
||
47 | } |
||
48 | } |
||
49 |