Completed
Push — master ( d15cf4...5163a0 )
by Valentyn
06:05
created

MovieTranslationRules::getDefaultRules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App\Movies\Validation;
4
5
use Symfony\Component\Validator\Constraints as Assert;
6
7
class MovieTranslationRules
8
{
9 3
    public static function getDefaultRules(): array
10
    {
11
        return [
12 3
            'locale' => [new Assert\NotBlank(), new Assert\Locale()],
13 3
            'title' => [new Assert\NotBlank(), new Assert\Length(['min' => 3, 'max' => 50])],
14 3
            'posterUrl' => [new Assert\NotBlank(), new Assert\Length(['min' => 10, 'max' => 255])],
15 3
            'overview' => [new Assert\NotBlank(), new Assert\Length(['min' => 50])],
16
        ];
17
    }
18
}