| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function rules() |
||
| 11 | { |
||
| 12 | return new Assert\Collection([ |
||
| 13 | 'movie' => new Assert\Collection([ |
||
| 14 | // Movie |
||
| 15 | 'originalTitle' => [new Assert\NotBlank(), new Assert\Length(['min' => 2, 'max' => 100])], |
||
| 16 | 'imdbId' => new Assert\Length(['min' => 5, 'max' => 20]), |
||
| 17 | 'runtime' => new Assert\Type(['type' => 'integer']), |
||
| 18 | 'budget' => new Assert\Type(['type' => 'integer']), |
||
| 19 | 'releaseDate' => new Assert\Date(), |
||
| 20 | // MovieTranslations[] |
||
| 21 | 'translations' => $this->eachItemValidation([ |
||
| 22 | 'locale' => [new Assert\NotBlank(), new Assert\Locale()], |
||
| 23 | 'title' => [new Assert\NotBlank(), new Assert\Length(['min' => 3, 'max' => 50])], |
||
| 24 | 'overview' => [new Assert\NotBlank()], |
||
| 25 | ]), |
||
| 26 | ]), |
||
| 27 | ]); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |