Completed
Push — master ( d41a9c...8343ec )
by Valentyn
04:11
created

UpdateUserRequest::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 8
cts 8
cp 1
rs 9.8666
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 UpdateUserRequest extends BaseRequest
9
{
10 4
    public function rules()
11
    {
12 4
        return new Assert\Collection([
13 4
            'profile' => new Assert\Collection([
14 4
                'first_name' => new Assert\Length(['min' => 2, 'max' => 50]),
15 4
                'last_name' => new Assert\Length(['min' => 2, 'max' => 50]),
16 4
                'birth_date' => new Assert\Date(),
17 4
                'about' => new Assert\Length(['max' => 255]),
18 4
                'public_email' => new Assert\Email(),
19
            ]),
20
        ]);
21
    }
22
}
23