Code cleanup.

This commit is contained in:
James Cole
2021-03-28 11:46:23 +02:00
parent 2c575f3ca5
commit b5eeacc128
124 changed files with 1568 additions and 1384 deletions

View File

@@ -23,6 +23,7 @@
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank;
use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\PiggyBank;
@@ -54,7 +55,7 @@ class AmountController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('title', (string) trans('firefly.piggyBanks'));
app('view')->share('title', (string)trans('firefly.piggyBanks'));
app('view')->share('mainTitleIcon', 'fa-bullseye');
$this->piggyRepos = app(PiggyBankRepositoryInterface::class);
@@ -124,7 +125,7 @@ class AmountController extends Controller
$this->piggyRepos->createEvent($piggyBank, $amount);
session()->flash(
'success',
(string) trans(
(string)trans(
'firefly.added_amount_to_piggy',
['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name]
)
@@ -137,7 +138,7 @@ class AmountController extends Controller
Log::error('Cannot add ' . $amount . ' because canAddAmount returned false.');
session()->flash(
'error',
(string) trans(
(string)trans(
'firefly.cannot_add_amount_piggy',
['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => e($piggyBank->name)]
)
@@ -166,7 +167,7 @@ class AmountController extends Controller
$this->piggyRepos->removeAmount($piggyBank, $amount);
session()->flash(
'success',
(string) trans(
(string)trans(
'firefly.removed_amount_from_piggy',
['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name]
)
@@ -175,11 +176,11 @@ class AmountController extends Controller
return redirect(route('piggy-banks.index'));
}
$amount = number_format((float) $request->get('amount'), 12, '.', '');
$amount = number_format((float)$request->get('amount'), 12, '.', '');
session()->flash(
'error',
(string) trans(
(string)trans(
'firefly.cannot_remove_from_piggy',
['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => e($piggyBank->name)]
)