RegisterUserRequest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 12
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A rules() 0 9 1
1
<?php
2
3
namespace Fesor\RequestObject\Examples\Request;
4
5
use Fesor\RequestObject\RequestObject;
6
use Symfony\Component\Validator\Constraints as Assert;
7
8
class RegisterUserRequest extends RequestObject
9
{
10
    public function rules()
11
    {
12
        return new Assert\Collection([
13
            'email' => new Assert\Email(['message' => 'Please fill in valid email']),
14
            'password' => new Assert\Length(['min' => 4, 'minMessage' => 'Password is to short']),
15
            'first_name' => new Assert\Type(['type' => 'string', 'message' => 'Please provide your first name']),
16
            'last_name' => new Assert\Type(['type' => 'string', 'message' => 'Please provide your last name']),
17
        ]);
18
    }
19
}
20