| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function canConvert(string $path): bool |
||
| 11 | { |
||
| 12 | if (! file_exists($path)) { |
||
| 13 | return false; |
||
| 14 | } |
||
| 15 | |||
| 16 | if (! $this->requirementsAreInstalled()) { |
||
| 17 | return false; |
||
| 18 | } |
||
| 19 | |||
| 20 | if ($this->supportedExtensions()->contains(pathinfo($path, PATHINFO_EXTENSION))) { |
||
| 21 | return true; |
||
| 22 | } |
||
| 23 | |||
| 24 | if ($this->supportedMimetypes()->contains(File::getMimetype($path))) { |
||
| 25 | return true; |
||
| 26 | } |
||
| 27 | |||
| 28 | return false; |
||
| 29 | } |
||
| 30 | |||
| 52 |