Passed
Push — master ( 30b5af...c8fd96 )
by Peter
04:21
created

File   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createValidator() 0 30 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Files\Validation\Factory\Api;
6
7
use Opulence\Validation\Factories\ValidatorFactory;
8
use Opulence\Validation\IValidator;
9
10
class File extends ValidatorFactory
11
{
12
    /**
13
     * @return IValidator
14
     */
15
    public function createValidator(): IValidator
16
    {
17
        $validator = parent::createValidator();
18
19
        $validator
20
            ->field('id')
21
            ->uuid();
22
23
        $validator
24
            ->field('description')
25
            ->required();
26
27
        $validator
28
            ->field('category_id')
29
            ->uuid()
30
            ->required();
31
32
        $validator
33
            ->field('data')
34
            ->base64();
35
36
        $validator
37
            ->field('name')
38
            ->required();
39
40
        $validator
41
            ->field('mime')
42
            ->required();
43
44
        return $validator;
45
    }
46
}
47