| Total Complexity | 3 | 
| Total Lines | 56 | 
| Duplicated Lines | 0 % | 
| Coverage | 0% | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 12 | class UpdateWorkSampleValidator extends BaseDataValidator implements DataValidator  | 
            ||
| 13 | { | 
            ||
| 14 | |||
| 15 | /**  | 
            ||
| 16 | * Array of all possible FileType ids.  | 
            ||
| 17 | *  | 
            ||
| 18 | * @var int[]  | 
            ||
| 19 | */  | 
            ||
| 20 | protected $fileTypeIds;  | 
            ||
| 21 | |||
| 22 | /**  | 
            ||
| 23 | * Array of all possible skill ids.  | 
            ||
| 24 | *  | 
            ||
| 25 | * @var int[]  | 
            ||
| 26 | */  | 
            ||
| 27 | protected $skillIds;  | 
            ||
| 28 | |||
| 29 | /**  | 
            ||
| 30 | * Construct a new UpdateWorkSampleValidator  | 
            ||
| 31 | */  | 
            ||
| 32 | public function __construct()  | 
            ||
| 36 | }  | 
            ||
| 37 | /**  | 
            ||
| 38 | * Get the validation rules that apply to the request.  | 
            ||
| 39 | *  | 
            ||
| 40 | * @return mixed[]  | 
            ||
| 41 | */  | 
            ||
| 42 | public function rules() : array  | 
            ||
| 43 |     { | 
            ||
| 44 | return [  | 
            ||
| 45 | // Name validation  | 
            ||
| 46 | 'name' => 'required|string|max:191',  | 
            ||
| 47 | 'file_type_id' => [  | 
            ||
| 48 | 'required',  | 
            ||
| 49 | Rule::in($this->fileTypeIds)  | 
            ||
| 50 | ],  | 
            ||
| 51 | 'url' => 'required|url',  | 
            ||
| 52 | 'description' => 'nullable|string',  | 
            ||
| 53 | 'relatives.skills.*.id' => [  | 
            ||
| 54 | Rule::in($this->skillIds)  | 
            ||
| 55 | ],  | 
            ||
| 56 | ];  | 
            ||
| 57 | }  | 
            ||
| 58 | |||
| 59 | /**  | 
            ||
| 60 | * Returns a validator made with this data  | 
            ||
| 61 | *  | 
            ||
| 62 | * @param mixed[] $data Data to validate.  | 
            ||
| 63 | * @return Validator  | 
            ||
| 64 | */  | 
            ||
| 65 | public function validator(array $data) : \Illuminate\Validation\Validator  | 
            ||
| 68 | }  | 
            ||
| 69 | }  | 
            ||
| 70 |