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