| 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 | 12 | public static function getBasePath() |
|
| 21 | { |
||
| 22 | 12 | if (static::$basePath === null) { |
|
| 23 | 10 | static::$basePath = static::detectAppPath(); |
|
| 24 | } |
||
| 25 | 12 | return static::$basePath; |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param string|null $basePath |
||
| 30 | */ |
||
| 31 | 12 | public static function setBasePath($basePath) |
|
| 34 | 12 | } |
|
| 35 | |||
| 36 | /** |
||
| 37 | * @return null|string |
||
| 38 | */ |
||
| 39 | 10 | protected static function detectAppPath() |
|
| 53 | } |
||
| 54 | } |