Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.009 |
Changes | 0 |
1 | <?php |
||
39 | 7 | protected static function detectAppPath() |
|
40 | { |
||
41 | 7 | $basePath = __DIR__; |
|
42 | |||
43 | 7 | $maxStep = 5; |
|
44 | 7 | $step = 0; |
|
45 | 7 | while ($step <= $maxStep) { |
|
46 | 7 | $basePath = dirname($basePath); |
|
47 | 7 | if (file_exists($basePath . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php')) { |
|
48 | 7 | return $basePath; |
|
49 | } |
||
50 | 7 | $step++; |
|
51 | } |
||
52 | return null; |
||
53 | } |
||
54 | } |