Completed
Pull Request — master (#21)
by Valentyn
01:42
created

CreateGenreRequest   A

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
wmc 1
lcom 0
cbo 4
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A rules() 0 11 1
1
<?php
2
3
namespace App\Request\Genre;
4
5
use App\Request\BaseRequest;
6
use Symfony\Component\Validator\Constraints as Assert;
7
8
class CreateGenreRequest extends BaseRequest
9
{
10 4
    public function rules()
11
    {
12 4
        return new Assert\Collection([
13 4
            'genre' => new Assert\Collection([
14 4
                'translations' => $this->eachItemValidation([
15 4
                    'name' => new Assert\Length(['min' => 3, 'max' => 50]),
16 4
                    'locale' => new Assert\Locale(),
17
                ]),
18
            ]),
19
        ]);
20
    }
21
}