Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.125 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
19 | 2 | public static function getProjectRootDirectory(): string |
|
20 | { |
||
21 | try { |
||
22 | 2 | if (null === self::$projectRootDirectory) { |
|
23 | 1 | $reflection = new \ReflectionClass(ClassLoader::class); |
|
24 | 1 | self::$projectRootDirectory = \dirname($reflection->getFileName(), 3); |
|
25 | } |
||
26 | |||
27 | 2 | return self::$projectRootDirectory; |
|
28 | } catch (\Exception $e) { |
||
29 | throw new \Exception( |
||
30 | 'Exception in '.__METHOD__.': '.$e->getMessage(), |
||
31 | $e->getCode(), |
||
32 | $e |
||
33 | ); |
||
55 |