Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 94.12% |
Changes | 0 |
1 | <?php |
||
9 | trait HasBasePathTrait |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * @var null|string |
||
14 | */ |
||
15 | protected static $basePath = null; |
||
16 | |||
17 | /** |
||
18 | * @return null|string |
||
19 | */ |
||
20 | 9 | public static function getBasePath() |
|
21 | { |
||
22 | 9 | if (static::$basePath === null) { |
|
23 | 7 | static::$basePath = static::detectAppPath(); |
|
24 | } |
||
25 | 9 | return static::$basePath; |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param string|null $basePath |
||
30 | */ |
||
31 | 9 | public static function setBasePath($basePath) |
|
34 | 9 | } |
|
35 | |||
36 | /** |
||
37 | * @return null|string |
||
38 | */ |
||
39 | 7 | protected static function detectAppPath() |
|
53 | } |
||
54 | } |