File::createValidator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 16
rs 9.9332
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Files\Validation\Factory;
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
26
        $validator
27
            ->field('category_id')
28
            ->uuid();
29
30
        return $validator;
31
    }
32
}
33