| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 3 | public function test($value) |
|
| 22 | { |
||
| 23 | 3 | if (! $value instanceof UploadedFileInterface) { |
|
| 24 | 1 | throw new InvalidArgumentException(sprintf( |
|
| 25 | 1 | 'MimeType rule excepts field of type %s, %s given.', |
|
| 26 | 1 | UploadedFileInterface::class, |
|
| 27 | 1 | gettype($value) |
|
| 28 | 1 | )); |
|
| 29 | } |
||
| 30 | |||
| 31 | 2 | return $this->mimeType == $value->getClientMediaType(); |
|
| 32 | } |
||
| 33 | } |