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