Clean up some code.

This commit is contained in:
James Cole
2024-12-14 05:45:54 +01:00
parent b930ad4da7
commit 7d8d773f8f
78 changed files with 2760 additions and 2674 deletions

View File

@@ -59,7 +59,7 @@ class PiggyBankStoreRequest extends FormRequest
$accounts = [];
}
foreach ($accounts as $item) {
$data['accounts'][] = ['account_id' => (int) ($item)];
$data['accounts'][] = ['account_id' => (int) $item];
}
return $data;
@@ -105,7 +105,7 @@ class PiggyBankStoreRequest extends FormRequest
if ($accountCurrency->id !== $currency->id && 'true' !== $isMultiCurrency) {
$validator->errors()->add('accounts', trans('validation.invalid_account_currency'));
}
$type = $account->accountType->type;
$type = $account->accountType->type;
if (!in_array($type, $types, true)) {
$validator->errors()->add('accounts', trans('validation.invalid_account_type'));
}
@@ -127,6 +127,7 @@ class PiggyBankStoreRequest extends FormRequest
if (null === $currency) {
return app('amount')->getDefaultCurrency();
}
return $currency;
}
}