Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Small code cleanup.
James Colec61389037d97
diff --git a/app/Handlers/Observer/AccountObserver.php b/app/Handlers/Observer/AccountObserver.phpindex 6adbe9fcd6..b9f6156c86 100644--- a/app/Handlers/Observer/AccountObserver.php+++ b/app/Handlers/Observer/AccountObserver.php@@ -82,6 +82,7 @@ class AccountObserverforeach ($account->piggyBanks()->get() as $piggy) {$piggy->accounts()->detach($account);}+/** @var Attachment $attachment */foreach ($account->attachments()->get() as $attachment) {$repository->destroy($attachment);diff --git a/app/Handlers/Observer/TransactionJournalObserver.php b/app/Handlers/Observer/TransactionJournalObserver.phpindex adaed2b902..cb4bea3d4c 100644--- a/app/Handlers/Observer/TransactionJournalObserver.php+++ b/app/Handlers/Observer/TransactionJournalObserver.php@@ -46,6 +46,7 @@ class TransactionJournalObserver$transaction->delete();}});+/** @var Attachment $attachment */foreach ($transactionJournal->attachments()->get() as $attachment) {$repository->destroy($attachment);diff --git a/app/Support/Search/QueryParser/Node.php b/app/Support/Search/QueryParser/Node.phpindex e00f513585..f13331965c 100644--- a/app/Support/Search/QueryParser/Node.php+++ b/app/Support/Search/QueryParser/Node.php@@ -66,6 +66,7 @@ abstract class Nodeif ($compare instanceof NodeGroup && $this instanceof NodeGroup) {if (count($compare->getNodes()) !== count($this->getNodes())) {Log::debug(sprintf('Return false because node count is different. Original is %d, compare is %d', count($this->getNodes()), count($compare->getNodes())));+return false;}@@ -76,6 +77,7 @@ abstract class Nodeforeach ($this->getNodes() as $index => $node) {if (false === $node->equals($compare->getNodes()[$index])) {Log::debug('Return false because nodes are different!');+return false;}}diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.phpindex 62a5694f87..9a70e1da0f 100644--- a/app/Support/Twig/AmountFormat.php+++ b/app/Support/Twig/AmountFormat.php@@ -114,7 +114,7 @@ class AmountFormat extends AbstractExtensionstatic function (string $amount, string $code, ?bool $coloured = null): string {$coloured ??= true;- /** @var TransactionCurrency|null $currency */+ /** @var null|TransactionCurrency $currency */$currency = TransactionCurrency::whereCode($code)->first();if (null === $currency) {Log::error(sprintf('Could not find currency with code "%s". Fallback to native currency.', $code));