RegisterUserRequest::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 6
cp 1
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App\Users\Request;
4
5
use App\Request\BaseRequest;
6
use Symfony\Component\Validator\Constraints as Assert;
7
8
class RegisterUserRequest extends BaseRequest
9
{
10 5
    public function rules()
11
    {
12
        // maybe move common rules to "RuleSets" to prevent code duplication? (post-lunch)
13 5
        return new Assert\Collection([
14 5
            'registration' => new Assert\Collection([
15 5
                'email' => new Assert\Email(),
16 5
                'password' => new Assert\Length(['min' => 4, 'max' => 4096]),
17 5
                'username' => new Assert\Length(['min' => 4, 'max' => 50]),
18
            ]),
19
        ]);
20
    }
21
}
22