Passed
Push — master ( 7ba2cb...1d30f9 )
by Peter
02:20
created

UserApiKey::createValidator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 17
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Validation\Factory;
6
7
use Opulence\Validation\Factories\ValidatorFactory;
8
use Opulence\Validation\IValidator;
9
10
class UserApiKey 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('admin_resource_ids')
29
            ->required();
30
31
        return $validator;
32
    }
33
}
34