Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
21 | public function validate(DegreeValidator $degreeValidator) |
||
22 | { |
||
23 | $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $degreeValidator->id); |
||
24 | //This array is reset every time because applicants table can change frequently |
||
25 | $applicant_ids = Applicant::all()->pluck('id'); |
||
26 | //Validate basic data is filled in |
||
27 | Validator::make($degreeValidator->getAttributes(), [ |
||
28 | 'applicant_id' => [ |
||
29 | 'required', |
||
30 | Rule::in($applicant_ids->toArray()), |
||
31 | ], |
||
32 | 'degree_type_id' => [ |
||
33 | 'required', |
||
34 | Rule::in($this->degree_type_id->toArray()), |
||
35 | ] |
||
36 | |||
37 | ])->validate(); |
||
38 | } |
||
40 | } |