Remove many references to (float)

This commit is contained in:
James Cole
2022-12-24 05:06:39 +01:00
parent e43372b2ce
commit c47980a737
41 changed files with 230 additions and 208 deletions

View File

@@ -104,9 +104,10 @@ class StoreRequest extends FormRequest
$validator->after(
static function (Validator $validator) {
$data = $validator->getData();
$min = (float) ($data['amount_min'] ?? 0);
$max = (float) ($data['amount_max'] ?? 0);
if ($min > $max) {
$min = $data['amount_min'] ?? '0';
$max = $data['amount_max'] ?? '0';
if (1 === bccomp($min, $max)) {
$validator->errors()->add('amount_min', (string) trans('validation.amount_min_over_max'));
}
}