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