| 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 | 10 | protected static function detectAppPath() |
|
| 40 | { |
||
| 41 | 10 | $basePath = __DIR__; |
|
| 42 | |||
| 43 | 10 | $maxStep = 5; |
|
| 44 | 10 | $step = 0; |
|
| 45 | 10 | while ($step <= $maxStep) { |
|
| 46 | 10 | $basePath = dirname($basePath); |
|
| 47 | 10 | if (file_exists($basePath . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php')) { |
|
| 48 | 10 | return $basePath; |
|
| 49 | } |
||
| 50 | 10 | $step++; |
|
| 51 | } |
||
| 52 | return null; |
||
| 53 | } |
||
| 54 | } |