| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function validateItem(array $values): array |
||
| 19 | { |
||
| 20 | $validator = Validator::make($this->values($values), [ |
||
| 21 | 'name' => 'required|string|min:1', |
||
| 22 | 'shortname' => 'required|string|between:1,25', |
||
| 23 | 'biography' => 'nullable|string', |
||
| 24 | 'email' => 'nullable|email', |
||
| 25 | 'phone' => 'nullable|phone:AUTO', |
||
| 26 | 'city' => 'nullable|string|min:1', |
||
| 27 | 'address' => 'nullable|string', |
||
| 28 | 'website' => 'nullable|string', |
||
| 29 | 'country_code' => ['required', new CountryCode()], |
||
| 30 | 'currency_code' => ['required', new CurrencyCode()], |
||
| 31 | ]); |
||
| 32 | if($validator->fails()) |
||
| 33 | { |
||
| 34 | throw new ValidationException($validator); |
||
| 35 | } |
||
| 36 | return $validator->validated(); |
||
| 37 | } |
||
| 39 |