Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 23 | public static function validateBootstrapPath(bool $isPhar, Config $config): string |
|
35 | { |
||
36 | 23 | $bootstrapFile = dirname($config->getPath()) . '/' . $config->getBootstrap(); |
|
37 | 23 | if (!file_exists($bootstrapFile)) { |
|
38 | // since the phar has its own autoloader we don't need to do anything |
||
39 | // if the bootstrap file is not actively set |
||
40 | 4 | if ($isPhar && empty($config->getBootstrap(''))) { |
|
41 | 1 | return ''; |
|
42 | } |
||
43 | 3 | throw new RuntimeException('bootstrap file not found'); |
|
44 | } |
||
45 | 19 | return $bootstrapFile; |
|
46 | } |
||
64 |