Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 2 | protected function validateValue($value, ValidationContext $context = null): Result |
|
29 | { |
||
30 | 2 | $result = new Result(); |
|
31 | |||
32 | 2 | $mimeType = $value; |
|
33 | |||
34 | 2 | if ($value instanceof UploadedFileInterface) { |
|
35 | 1 | $mimeType = $value->getClientMediaType(); |
|
36 | } |
||
37 | |||
38 | 2 | if (!in_array($mimeType, $this->mimeTypes, true)) { |
|
39 | 2 | $result->addError($this->formatMessage($this->message)); |
|
40 | } |
||
41 | |||
42 | 2 | return $result; |
|
43 | } |
||
55 |