| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function validateItem(array $values): array |
||
| 35 | { |
||
| 36 | $validator = Validator::make($this->values($values), [ |
||
| 37 | 'member' => 'required|integer|min:0', |
||
| 38 | 'charge' => 'required|integer|min:0', |
||
| 39 | 'category' => 'required|integer|min:1', |
||
| 40 | 'amount' => $this->amountRule(), |
||
| 41 | 'comment' => 'present|between:0,150', |
||
| 42 | ]); |
||
| 43 | if($validator->fails()) |
||
| 44 | { |
||
| 45 | throw new ValidationException($validator); |
||
| 46 | } |
||
| 47 | |||
| 48 | $validated = $validator->validated(); |
||
| 49 | $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']); |
||
| 50 | return $validated; |
||
| 51 | } |
||
| 53 |