mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 00:20:03 +00:00
Use PSR-12 code style
This commit is contained in:
@@ -160,7 +160,7 @@ class BudgetLimitController extends Controller
|
||||
if ((int) $amount > 268435456) {
|
||||
$amount = '268435456';
|
||||
}
|
||||
if((float) $amount < 0.0) {
|
||||
if ((float) $amount < 0.0) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ class BudgetLimitController extends Controller
|
||||
if ((int) $amount > 268435456) { // 268 million
|
||||
$amount = '268435456';
|
||||
}
|
||||
if((float) $amount < 0.0) {
|
||||
if ((float) $amount < 0.0) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
|
||||
|
||||
@@ -139,11 +139,9 @@ class CreateController extends Controller
|
||||
$redirect = redirect($this->getPreviousUrl('budgets.create.url'));
|
||||
|
||||
if (1 === (int) $request->get('create_another')) {
|
||||
|
||||
$request->session()->put('budgets.create.fromStore', true);
|
||||
|
||||
$redirect = redirect(route('budgets.create'))->withInput();
|
||||
|
||||
}
|
||||
|
||||
return $redirect;
|
||||
|
||||
@@ -95,5 +95,4 @@ class DeleteController extends Controller
|
||||
|
||||
return redirect($this->getPreviousUrl('budgets.delete.url'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -149,11 +149,9 @@ class EditController extends Controller
|
||||
}
|
||||
|
||||
if (1 === (int) $request->get('return_to_edit')) {
|
||||
|
||||
$request->session()->put('budgets.edit.fromUpdate', true);
|
||||
|
||||
$redirect = redirect(route('budgets.edit', [$budget->id]))->withInput(['return_to_edit' => 1]);
|
||||
|
||||
}
|
||||
|
||||
return $redirect;
|
||||
|
||||
@@ -123,7 +123,7 @@ class IndexController extends Controller
|
||||
|
||||
// get budgeted for default currency:
|
||||
if (empty($availableBudgets)) {
|
||||
$budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency,);
|
||||
$budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency, );
|
||||
$spentArr = $this->opsRepository->sumExpenses($start, $end, null, null, $defaultCurrency);
|
||||
$spent = $spentArr[$defaultCurrency->id]['sum'] ?? '0';
|
||||
unset($spentArr);
|
||||
@@ -137,10 +137,25 @@ class IndexController extends Controller
|
||||
$inactive = $this->repository->getInactiveBudgets();
|
||||
|
||||
return view(
|
||||
'budgets.index', compact(
|
||||
'availableBudgets', 'budgeted', 'spent', 'prevLoop', 'nextLoop', 'budgets', 'currencies', 'periodTitle',
|
||||
'defaultCurrency', 'activeDaysPassed', 'activeDaysLeft', 'inactive', 'budgets', 'start', 'end', 'sums'
|
||||
)
|
||||
'budgets.index',
|
||||
compact(
|
||||
'availableBudgets',
|
||||
'budgeted',
|
||||
'spent',
|
||||
'prevLoop',
|
||||
'nextLoop',
|
||||
'budgets',
|
||||
'currencies',
|
||||
'periodTitle',
|
||||
'defaultCurrency',
|
||||
'activeDaysPassed',
|
||||
'activeDaysLeft',
|
||||
'inactive',
|
||||
'budgets',
|
||||
'start',
|
||||
'end',
|
||||
'sums'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -167,7 +182,7 @@ class IndexController extends Controller
|
||||
$array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0';
|
||||
|
||||
// budgeted in period:
|
||||
$budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency,);
|
||||
$budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency, );
|
||||
$array['budgeted'] = $budgeted;
|
||||
$availableBudgets[] = $array;
|
||||
unset($spentArr);
|
||||
|
||||
@@ -44,7 +44,8 @@ use Illuminate\View\View;
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
{
|
||||
use PeriodOverview, AugumentData;
|
||||
use PeriodOverview;
|
||||
use AugumentData;
|
||||
|
||||
protected JournalRepositoryInterface $journalRepos;
|
||||
private BudgetRepositoryInterface $repository;
|
||||
@@ -123,10 +124,9 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function noBudgetAll(Request $request)
|
||||
{
|
||||
|
||||
$subTitle = (string) trans('firefly.all_journals_without_budget');
|
||||
$first = $this->journalRepos->firstNull();
|
||||
$start = null === $first ? new Carbon : $first->date;
|
||||
$start = null === $first ? new Carbon() : $first->date;
|
||||
$end = today(config('app.timezone'));
|
||||
$page = (int) $request->get('page');
|
||||
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
|
||||
|
||||
Reference in New Issue
Block a user