PhotoRequirements   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConstraints() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Validator;
6
7
use Symfony\Component\Validator\Constraints\Compound;
8
use Symfony\Component\Validator\Constraints\File;
9
use Symfony\Component\Validator\Constraints\NotBlank;
10
11
class PhotoRequirements extends Compound
12
{
13
    protected function getConstraints(array $options): array
14
    {
15
        return [
16
            new NotBlank([
17
                'message' => 'Please select a file to upload',
18
            ]),
19
            new File([
20
                'maxSize' => '12M',
21
                'mimeTypes' => [
22
                    'image/*',
23
                ],
24
            ]),
25
        ];
26
    }
27
}
28