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