| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.009 |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | 14 | public function __invoke(string $executable): string |
|
| 10 | { |
||
| 11 | 14 | $output = []; |
|
| 12 | 14 | $return = -1; |
|
| 13 | 14 | exec('which ' . escapeshellarg($executable), $output, $return); |
|
| 14 | 14 | if (0 !== (int) $return) { |
|
| 15 | 1 | return ''; |
|
| 16 | } |
||
| 17 | 13 | $count = count($output); |
|
| 18 | 13 | if (0 === $count) { |
|
| 19 | return ''; |
||
| 20 | } |
||
| 21 | 13 | return $output[$count - 1]; |
|
| 22 | } |
||
| 24 |