Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function validateItem(array $values): array |
||
37 | { |
||
38 | $validator = Validator::make($this->values($values), [ |
||
39 | 'global' => 'required|boolean', |
||
40 | 'amount' => $this->amountRule(), |
||
41 | 'deadline' => 'required|integer|min:1', |
||
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 |