We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | 10 | public function validate($input) |
|
| 27 | { |
||
| 28 | 10 | if ($input instanceof SplFileInfo) { |
|
| 29 | 3 | $input = $input->getPathname(); |
|
| 30 | 3 | } |
|
| 31 | |||
| 32 | 10 | if (!is_string($input)) { |
|
| 33 | 2 | return false; |
|
| 34 | } |
||
| 35 | |||
| 36 | 8 | if (!is_file($input)) { |
|
| 37 | 1 | return false; |
|
| 38 | } |
||
| 39 | |||
| 40 | 7 | return (0 === strpos($this->fileInfo->file($input), 'image/')); |
|
| 41 | } |
||
| 42 | } |
||
| 43 |