1 | <?php |
||
14 | class Image extends AbstractValidator |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * The error message as key for translation |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $errorMessage = 'validator_invalid_image_type'; |
||
22 | |||
23 | /** |
||
24 | * Valid image mime-types |
||
25 | * @var array |
||
26 | */ |
||
27 | private $validImageMimeTypes = [ |
||
28 | 'image/jpg', |
||
29 | 'image/jpeg', |
||
30 | 'image/png', |
||
31 | 'image/gif', |
||
32 | 'image/tiff', |
||
33 | 'image/psd', |
||
34 | 'image/x-icon', |
||
35 | 'image/svg+xml' |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * Validate image type within it's mime-type |
||
40 | * @param string $data |
||
41 | * @return boolean |
||
42 | */ |
||
43 | public function process($data) |
||
52 | |||
53 | } |