File   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createValidator() 0 29 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
            ->forbidden();
22
23
        $validator
24
            ->field('description')
25
            ->required();
26
27
        $validator
28
            ->field('category_id')
29
            ->uuid();
30
31
        $validator
32
            ->field('data')
33
            ->base64();
34
35
        $validator
36
            ->field('name')
37
            ->required();
38
39
        $validator
40
            ->field('mime')
41
            ->required();
42
43
        return $validator;
44
    }
45
}
46