| 1 | <?php |
||
| 20 | class FileValidator implements FileValidatorInterface |
||
| 21 | { |
||
| 22 | protected $errors; |
||
| 23 | protected $allowedTypes = [ |
||
| 24 | 'jpeg', |
||
| 25 | 'jpg', |
||
| 26 | 'png', |
||
| 27 | 'gif', |
||
| 28 | ]; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param UploadedFile $file |
||
| 32 | * |
||
| 33 | * @return bool |
||
| 34 | */ |
||
| 35 | public function validate(UploadedFile $file) |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return array |
||
| 59 | */ |
||
| 60 | public function getAllowedTypes() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param array $allowedTypes |
||
| 67 | */ |
||
| 68 | public function setAllowedTypes($allowedTypes) |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return mixed |
||
| 75 | */ |
||
| 76 | public function getErrors() |
||
| 80 | } |