Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
11 | 2 | public function rules() |
|
12 | { |
||
13 | 2 | return new Assert\Collection([ |
|
14 | 2 | 'actor' => new Assert\Collection([ |
|
15 | // Movie |
||
16 | 2 | 'originalName' => [new Assert\NotBlank(), new Assert\Length(['min' => 2, 'max' => 100])], |
|
17 | 2 | 'imdbId' => new Assert\Length(['min' => 5, 'max' => 20]), |
|
18 | 2 | 'birthday' => new Assert\Date(), |
|
19 | 2 | 'gender' => new Assert\Choice([Actor::GENDER_MALE, Actor::GENDER_FEMALE]), |
|
20 | // MovieTranslations[] |
||
21 | 2 | 'translations' => $this->eachItemValidation([ |
|
22 | 2 | 'locale' => [new Assert\NotBlank(), new Assert\Locale()], |
|
23 | 2 | 'name' => [new Assert\NotBlank(), new Assert\Length(['min' => 2, 'max' => 100])], |
|
24 | 2 | 'placeOfBirth' => [new Assert\NotBlank(), new Assert\Length(['max' => 100])], |
|
25 | 2 | 'biography' => [new Assert\NotBlank()], |
|
26 | ]), |
||
27 | ]), |
||
28 | ]); |
||
29 | } |
||
30 | } |
||
31 |