| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4.5923 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 6 | public static function getPhpBinary(): string |
|
| 32 | { |
||
| 33 | 6 | $extensionSettings = GeneralUtility::makeInstance(ExtensionConfigurationProvider::class)->getExtensionConfiguration(); |
|
| 34 | |||
| 35 | 5 | if (empty($extensionSettings)) { |
|
| 36 | 1 | throw new \Exception('ExtensionSettings are empty', 1587066853); |
|
| 37 | } |
||
| 38 | |||
| 39 | 4 | if (empty($extensionSettings['phpPath'])) { |
|
| 40 | 3 | $phpPath = CommandUtility::getCommand($extensionSettings['phpBinary']); |
|
| 41 | 3 | if (false === $phpPath) { |
|
| 42 | 3 | throw new \Exception('The phpBinary: "' . $extensionSettings['phpBinary'] . '" could not be found!', 1587068215); |
|
| 43 | } |
||
| 44 | } else { |
||
| 45 | 2 | $phpPath = $extensionSettings['phpPath']; |
|
| 46 | } |
||
| 47 | |||
| 48 | 3 | return $phpPath; |
|
| 49 | } |
||
| 51 |