Passed
Push — master ( bc25fe...f18d9c )
by Peter
03:21
created

NewUser::addPasswordFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 1
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 NewUser extends User
11
{
12
    /**
13
     * @param IValidator $validator
14
     */
15
    protected function addPasswordFields(IValidator $validator): void
16
    {
17
        $validator
18
            ->field('password')
19
            ->required();
20
21
        $validator
22
            ->field('password_confirmed')
23
            ->equalsField('password')
24
            ->required();
25
    }
26
}
27