mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-02 03:51:18 +00:00
Use PSR-12 code style
This commit is contained in:
@@ -104,7 +104,7 @@ class BulkController extends Controller
|
||||
$ignoreCategory = 1 === (int) $request->get('ignore_category');
|
||||
$ignoreBudget = 1 === (int) $request->get('ignore_budget');
|
||||
$tagsAction = $request->get('tags_action');
|
||||
$collection = new Collection;
|
||||
$collection = new Collection();
|
||||
$count = 0;
|
||||
|
||||
foreach ($journalIds as $journalId) {
|
||||
|
||||
@@ -167,10 +167,8 @@ class ConvertController extends Controller
|
||||
$role = 'l_' . $account->accountType->type;
|
||||
}
|
||||
if (AccountType::CASH === $account->accountType->type) {
|
||||
|
||||
$role = 'cash_account';
|
||||
$name = sprintf('(%s)', trans('firefly.cash'));
|
||||
|
||||
}
|
||||
if (AccountType::REVENUE === $account->accountType->type) {
|
||||
$role = 'revenue_account';
|
||||
@@ -208,10 +206,8 @@ class ConvertController extends Controller
|
||||
$role = 'l_' . $account->accountType->type;
|
||||
}
|
||||
if (AccountType::CASH === $account->accountType->type) {
|
||||
|
||||
$role = 'cash_account';
|
||||
$name = sprintf('(%s)', trans('firefly.cash'));
|
||||
|
||||
}
|
||||
if (AccountType::EXPENSE === $account->accountType->type) {
|
||||
$role = 'expense_account';
|
||||
|
||||
@@ -83,7 +83,7 @@ class DeleteController extends Controller
|
||||
|
||||
$journal = $group->transactionJournals->first();
|
||||
if (null === $journal) {
|
||||
throw new NotFoundHttpException;
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
$objectType = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
|
||||
$subTitle = (string) trans('firefly.delete_' . $objectType, ['description' => $group->title ?? $journal->description]);
|
||||
@@ -110,7 +110,7 @@ class DeleteController extends Controller
|
||||
|
||||
$journal = $group->transactionJournals->first();
|
||||
if (null === $journal) {
|
||||
throw new NotFoundHttpException;
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
$objectType = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
|
||||
session()->flash('success', (string) trans('firefly.deleted_' . strtolower($objectType), ['description' => $group->title ?? $journal->description]));
|
||||
@@ -118,12 +118,12 @@ class DeleteController extends Controller
|
||||
// grab asset account(s) from group:
|
||||
$accounts = [];
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach($group->transactionJournals as $journal) {
|
||||
foreach ($group->transactionJournals as $journal) {
|
||||
/** @var Transaction $transaction */
|
||||
foreach($journal->transactions as $transaction) {
|
||||
foreach ($journal->transactions as $transaction) {
|
||||
$type = $transaction->account->accountType->type;
|
||||
// if is valid liability, trigger event!
|
||||
if(in_array($type, config('firefly.valid_liabilities'))) {
|
||||
if (in_array($type, config('firefly.valid_liabilities'), true)) {
|
||||
$accounts[] = $transaction->account;
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ class DeleteController extends Controller
|
||||
|
||||
|
||||
/** @var Account $account */
|
||||
foreach($accounts as $account) {
|
||||
foreach ($accounts as $account) {
|
||||
Log::debug(sprintf('Now going to trigger updated account event for account #%d', $account->id));
|
||||
event(new UpdatedAccount($account));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ class EditController extends Controller
|
||||
// some useful repositories:
|
||||
$this->middleware(
|
||||
static function ($request, $next) {
|
||||
|
||||
app('view')->share('title', (string) trans('firefly.transactions'));
|
||||
app('view')->share('mainTitleIcon', 'fa-exchange');
|
||||
|
||||
@@ -88,10 +87,15 @@ class EditController extends Controller
|
||||
return view(
|
||||
'transactions.edit',
|
||||
compact(
|
||||
'cash', 'allowedSourceDests', 'expectedSourceTypes', 'transactionGroup', 'allowedOpposingTypes', 'accountToTypes', 'defaultCurrency',
|
||||
'cash',
|
||||
'allowedSourceDests',
|
||||
'expectedSourceTypes',
|
||||
'transactionGroup',
|
||||
'allowedOpposingTypes',
|
||||
'accountToTypes',
|
||||
'defaultCurrency',
|
||||
'previousUrl'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class IndexController extends Controller
|
||||
$subTitle = (string) trans(sprintf('firefly.title_%s_between', $objectType), ['start' => $startStr, 'end' => $endStr]);
|
||||
|
||||
$firstJournal = $this->repository->firstNull();
|
||||
$startPeriod = null === $firstJournal ? new Carbon : $firstJournal->date;
|
||||
$startPeriod = null === $firstJournal ? new Carbon() : $firstJournal->date;
|
||||
$endPeriod = clone $end;
|
||||
$periods = $this->getTransactionPeriodOverview($objectType, $startPeriod, $endPeriod);
|
||||
|
||||
@@ -144,7 +144,7 @@ class IndexController extends Controller
|
||||
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
|
||||
$path = route('transactions.index.all', [$objectType]);
|
||||
$first = $this->repository->firstNull();
|
||||
$start = null === $first ? new Carbon : $first->date;
|
||||
$start = null === $first ? new Carbon() : $first->date;
|
||||
$last = $this->repository->getLast();
|
||||
$end = $last ? $last->date : today(config('app.timezone'));
|
||||
$subTitle = (string) trans('firefly.all_' . $objectType);
|
||||
|
||||
@@ -102,7 +102,6 @@ class MassController extends Controller
|
||||
if (is_array($ids)) {
|
||||
/** @var string $journalId */
|
||||
foreach ($ids as $journalId) {
|
||||
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->repository->find((int) $journalId);
|
||||
if (null !== $journal && (int) $journalId === $journal->id) {
|
||||
|
||||
@@ -36,7 +36,6 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
|
||||
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
@@ -99,7 +98,7 @@ class ShowController extends Controller
|
||||
|
||||
/** @var TransactionGroupTransformer $transformer */
|
||||
$transformer = app(TransactionGroupTransformer::class);
|
||||
$transformer->setParameters(new ParameterBag);
|
||||
$transformer->setParameters(new ParameterBag());
|
||||
$groupArray = $transformer->transformObject($transactionGroup);
|
||||
|
||||
// do some calculations:
|
||||
@@ -112,7 +111,7 @@ class ShowController extends Controller
|
||||
|
||||
// get audit log entries:
|
||||
$logEntries = [];
|
||||
foreach($transactionGroup->transactionJournals as $journal) {
|
||||
foreach ($transactionGroup->transactionJournals as $journal) {
|
||||
$logEntries[$journal->id] = $this->ALERepository->getForObject($journal);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user