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