Conditions | 4 |
Paths | 6 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 5.4042 |
Changes | 0 |
1 | <?php |
||
29 | 1 | public function ensureBinaryExists(): void |
|
30 | { |
||
31 | 1 | $binary = $this->getBinary(); |
|
32 | // Case of binary (no path given), we cannot tell |
||
33 | 1 | if (basename($binary) === $binary) { |
|
34 | 1 | $exists = true; // assume it exists |
|
35 | } else { |
||
36 | $exists = file_exists($binary) && is_executable($binary); |
||
37 | } |
||
38 | |||
39 | 1 | if (!$exists) { |
|
40 | throw new MissingBinaryException(sprintf( |
||
41 | 'Missing ffprobe binary "%s"', |
||
42 | $binary |
||
43 | )); |
||
47 |