@@ -46,7 +46,7 @@ |
||
46 | 46 | { |
47 | 47 | parent::__construct(); |
48 | 48 | $this->middleware( |
49 | - static function ($request, $next) { |
|
49 | + static function($request, $next) { |
|
50 | 50 | app('view')->share('title', (string)trans('firefly.administration')); |
51 | 51 | app('view')->share('mainTitleIcon', 'fa-hand-spock-o'); |
52 | 52 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | try { |
48 | 48 | $client = new Client(); |
49 | 49 | $res = $client->request('GET', $uri); |
50 | - } catch (GuzzleException|Exception $e) { |
|
50 | + } catch (GuzzleException | Exception $e) { |
|
51 | 51 | throw new FireflyException(sprintf('Response error from update check: %s', $e->getMessage())); |
52 | 52 | } |
53 | 53 |
@@ -77,7 +77,6 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @return bool |
79 | 79 | * |
80 | - |
|
81 | 80 | */ |
82 | 81 | public function destroy(Account $account, ?Account $moveTo): bool |
83 | 82 | { |
@@ -101,7 +100,7 @@ discard block |
||
101 | 100 | /** @var Account $account */ |
102 | 101 | foreach ($accounts as $account) { |
103 | 102 | $byName = $this->user->accounts()->where('name', $account->name) |
104 | - ->where('id', '!=', $account->id)->first(); |
|
103 | + ->where('id', '!=', $account->id)->first(); |
|
105 | 104 | if (null !== $byName) { |
106 | 105 | $result->push($account); |
107 | 106 | $result->push($byName); |
@@ -109,7 +108,7 @@ discard block |
||
109 | 108 | } |
110 | 109 | if (null !== $account->iban) { |
111 | 110 | $byIban = $this->user->accounts()->where('iban', $account->iban) |
112 | - ->where('id', '!=', $account->id)->first(); |
|
111 | + ->where('id', '!=', $account->id)->first(); |
|
113 | 112 | if (null !== $byIban) { |
114 | 113 | $result->push($account); |
115 | 114 | $result->push($byIban); |
@@ -400,9 +399,9 @@ discard block |
||
400 | 399 | { |
401 | 400 | |
402 | 401 | $journal = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') |
403 | - ->where('transactions.account_id', $account->id) |
|
404 | - ->transactionTypes([TransactionType::OPENING_BALANCE]) |
|
405 | - ->first(['transaction_journals.*']); |
|
402 | + ->where('transactions.account_id', $account->id) |
|
403 | + ->transactionTypes([TransactionType::OPENING_BALANCE]) |
|
404 | + ->first(['transaction_journals.*']); |
|
406 | 405 | if (null === $journal) { |
407 | 406 | return null; |
408 | 407 | } |
@@ -424,9 +423,9 @@ discard block |
||
424 | 423 | public function getOpeningBalanceDate(Account $account): ?string |
425 | 424 | { |
426 | 425 | $journal = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') |
427 | - ->where('transactions.account_id', $account->id) |
|
428 | - ->transactionTypes([TransactionType::OPENING_BALANCE]) |
|
429 | - ->first(['transaction_journals.*']); |
|
426 | + ->where('transactions.account_id', $account->id) |
|
427 | + ->transactionTypes([TransactionType::OPENING_BALANCE]) |
|
428 | + ->first(['transaction_journals.*']); |
|
430 | 429 | if (null === $journal) { |
431 | 430 | return null; |
432 | 431 | } |
@@ -513,12 +512,12 @@ discard block |
||
513 | 512 | public function oldestJournal(Account $account): ?TransactionJournal |
514 | 513 | { |
515 | 514 | $first = $account->transactions() |
516 | - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') |
|
517 | - ->orderBy('transaction_journals.date', 'ASC') |
|
518 | - ->orderBy('transaction_journals.order', 'DESC') |
|
519 | - ->where('transaction_journals.user_id', $this->user->id) |
|
520 | - ->orderBy('transaction_journals.id', 'ASC') |
|
521 | - ->first(['transaction_journals.id']); |
|
515 | + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') |
|
516 | + ->orderBy('transaction_journals.date', 'ASC') |
|
517 | + ->orderBy('transaction_journals.order', 'DESC') |
|
518 | + ->where('transaction_journals.user_id', $this->user->id) |
|
519 | + ->orderBy('transaction_journals.id', 'ASC') |
|
520 | + ->first(['transaction_journals.id']); |
|
522 | 521 | if (null !== $first) { |
523 | 522 | return TransactionJournal::find((int)$first->id); |
524 | 523 | } |
@@ -553,9 +552,9 @@ discard block |
||
553 | 552 | public function searchAccount(string $query, array $types): Collection |
554 | 553 | { |
555 | 554 | $dbQuery = $this->user->accounts() |
556 | - ->where('active', 1) |
|
557 | - ->orderBy('accounts.name', 'ASC') |
|
558 | - ->with(['accountType']); |
|
555 | + ->where('active', 1) |
|
556 | + ->orderBy('accounts.name', 'ASC') |
|
557 | + ->with(['accountType']); |
|
559 | 558 | if ('' !== $query) { |
560 | 559 | $search = sprintf('%%%s%%', $query); |
561 | 560 | $dbQuery->where('name', 'LIKE', $search); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | 'name' => $data['name'], |
283 | 283 | ] |
284 | 284 | ); |
285 | - } catch(QueryException $e) { |
|
285 | + } catch (QueryException $e) { |
|
286 | 286 | throw new FireflyException('400002: Could not store budget.'); |
287 | 287 | } |
288 | 288 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | private function updateRuleActions(string $oldName, string $newName): void |
316 | 316 | { |
317 | - $types = ['set_budget',]; |
|
317 | + $types = ['set_budget', ]; |
|
318 | 318 | $actions = RuleAction::leftJoin('rules', 'rules.id', '=', 'rule_actions.rule_id') |
319 | 319 | ->where('rules.user_id', $this->user->id) |
320 | 320 | ->whereIn('rule_actions.action_type', $types) |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | private function updateRuleTriggers(string $oldName, string $newName): void |
337 | 337 | { |
338 | - $types = ['budget_is',]; |
|
338 | + $types = ['budget_is', ]; |
|
339 | 339 | $triggers = RuleTrigger::leftJoin('rules', 'rules.id', '=', 'rule_triggers.rule_id') |
340 | 340 | ->where('rules.user_id', $this->user->id) |
341 | 341 | ->whereIn('rule_triggers.trigger_type', $types) |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | parent::__construct(); |
61 | 61 | $this->middleware( |
62 | - function ($request, $next) { |
|
62 | + function($request, $next) { |
|
63 | 63 | /** @var User $user */ |
64 | 64 | $user = auth()->user(); |
65 | 65 | $this->repository = app(AttachmentRepositoryInterface::class); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if ('' === $content) { |
109 | 109 | throw new FireflyException('200002: File is empty (zero bytes).'); |
110 | 110 | } |
111 | - $quoted = sprintf('"%s"', addcslashes(basename($attachment->filename), '"\\')); |
|
111 | + $quoted = sprintf('"%s"', addcslashes(basename($attachment->filename), '"\\')); |
|
112 | 112 | |
113 | 113 | /** @var LaravelResponse $response */ |
114 | 114 | $response = response($content); |
@@ -86,7 +86,7 @@ |
||
86 | 86 | 'active' => $data['active'] ?? true, |
87 | 87 | ] |
88 | 88 | ); |
89 | - } catch(QueryException $e) { |
|
89 | + } catch (QueryException $e) { |
|
90 | 90 | Log::error($e->getMessage()); |
91 | 91 | Log::error($e->getTraceAsString()); |
92 | 92 | throw new FireflyException('400000: Could not store bill.'); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | /** @var RecurrenceTransaction $transaction */ |
220 | 220 | foreach ($transactions as $index => $transaction) { |
221 | 221 | |
222 | - $single = [ |
|
222 | + $single = [ |
|
223 | 223 | 'type' => strtolower($recurrence->transactionType->type), |
224 | 224 | 'date' => $date, |
225 | 225 | 'user' => $recurrence->user_id, |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | private function filterRecurrences(Collection $recurrences): Collection |
491 | 491 | { |
492 | 492 | return $recurrences->filter( |
493 | - function (Recurrence $recurrence) { |
|
493 | + function(Recurrence $recurrence) { |
|
494 | 494 | return $this->validRecurrence($recurrence); |
495 | 495 | } |
496 | 496 | ); |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | try { |
568 | 568 | /** @var PiggyBank $piggyBank */ |
569 | 569 | $piggyBank = PiggyBank::create($data); |
570 | - } catch(QueryException $e) { |
|
571 | - Log::error(sprintf('Could not store piggy bank: %s',$e->getMessage())); |
|
570 | + } catch (QueryException $e) { |
|
571 | + Log::error(sprintf('Could not store piggy bank: %s', $e->getMessage())); |
|
572 | 572 | throw new FireflyException('400005: Could not store new piggy bank.'); |
573 | 573 | } |
574 | 574 | |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | if (isset($data['targetdate']) && '' !== $data['targetdate']) { |
605 | 605 | $piggyBank->targetdate = $data['targetdate']; |
606 | 606 | } |
607 | - $piggyBank->startdate = $data['startdate'] ?? $piggyBank->startdate; |
|
607 | + $piggyBank->startdate = $data['startdate'] ?? $piggyBank->startdate; |
|
608 | 608 | $piggyBank->save(); |
609 | 609 | |
610 | 610 | $this->updateNote($piggyBank, $data['notes'] ?? ''); |