Conditions | 5 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function validate(UploadedFile $file): bool |
||
28 | { |
||
29 | foreach ($this->allowedMimeTypes as $mimeType) { |
||
30 | if ($mimeType === $file->getClientMimeType() |
||
31 | || (strpos($mimeType, '/*') !== false |
||
32 | && explode('/', $mimeType)[0] === explode('/', $file->getMimeType())[0]) |
||
|
|||
33 | ) { |
||
34 | return true; |
||
35 | } |
||
36 | } |
||
37 | return false; |
||
38 | } |
||
56 |