Total Complexity | 2 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | final class Php extends BasePath |
||
8 | { |
||
9 | /** |
||
10 | * Returns a direct link to the folder with the source localization files. |
||
11 | * |
||
12 | * If the file name is specified, a full link to the file will be returned, |
||
13 | * otherwise a direct link to the folder. |
||
14 | * |
||
15 | * @param string|null $locale |
||
16 | * @param string|null $filename |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | 48 | public function source(string $locale = null, string $filename = null): string |
|
21 | { |
||
22 | 48 | $locale = $this->getPathForEnglish($locale); |
|
|
|||
23 | 48 | $locale = $this->clean($locale); |
|
24 | 48 | $filename = $this->clean($filename); |
|
25 | |||
26 | 48 | return $this->real( |
|
27 | 48 | Config::getVendorPath() . $locale . $filename |
|
28 | ); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Returns the direct link to the localization folder or, |
||
33 | * if the file name is specified, a link to the localization file. |
||
34 | * |
||
35 | * If the file name or localization is not specified, |
||
36 | * the link to the shared folder of all localizations will be returned. |
||
37 | * |
||
38 | * @param string|null $locale |
||
39 | * @param string|null $filename |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | 48 | public function target(string $locale = null, string $filename = null): string |
|
49 | } |
||
50 | } |
||
51 |