RegisterUserRequest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 14
c 0
b 0
f 0
wmc 1
lcom 0
cbo 4
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A rules() 0 11 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