Fix a lot of phpstan things

This commit is contained in:
James Cole
2023-11-26 12:10:42 +01:00
parent a6c355c7b8
commit 68f01d932e
53 changed files with 214 additions and 120 deletions

View File

@@ -101,7 +101,11 @@ class EditController extends Controller
'auto_budget_currency_id' => $hasOldInput ? (int)$request->old('auto_budget_currency_id') : $currency->id,
];
if (null !== $autoBudget) {
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
if (is_array($amount)) {
$amount = '0';
}
$amount = (string)$amount;
$preFilled['auto_budget_amount'] = app('steam')->bcround($amount, $autoBudget->transactionCurrency->decimal_places);
}
@@ -135,6 +139,7 @@ class EditController extends Controller
$redirect = redirect($this->getPreviousUrl('budgets.edit.url'));
// store new attachment(s):
/** @var array|null $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
if (null !== $files && !auth()->user()->hasRole('demo')) {
$this->attachments->saveAttachmentsForModel($budget, $files);