mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-17 02:05:34 +00:00
Small code cleanup.
This commit is contained in:
@@ -82,6 +82,7 @@ class AccountObserver
|
|||||||
foreach ($account->piggyBanks()->get() as $piggy) {
|
foreach ($account->piggyBanks()->get() as $piggy) {
|
||||||
$piggy->accounts()->detach($account);
|
$piggy->accounts()->detach($account);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var Attachment $attachment */
|
/** @var Attachment $attachment */
|
||||||
foreach ($account->attachments()->get() as $attachment) {
|
foreach ($account->attachments()->get() as $attachment) {
|
||||||
$repository->destroy($attachment);
|
$repository->destroy($attachment);
|
||||||
|
@@ -46,6 +46,7 @@ class TransactionJournalObserver
|
|||||||
$transaction->delete();
|
$transaction->delete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/** @var Attachment $attachment */
|
/** @var Attachment $attachment */
|
||||||
foreach ($transactionJournal->attachments()->get() as $attachment) {
|
foreach ($transactionJournal->attachments()->get() as $attachment) {
|
||||||
$repository->destroy($attachment);
|
$repository->destroy($attachment);
|
||||||
|
@@ -66,6 +66,7 @@ abstract class Node
|
|||||||
if ($compare instanceof NodeGroup && $this instanceof NodeGroup) {
|
if ($compare instanceof NodeGroup && $this instanceof NodeGroup) {
|
||||||
if (count($compare->getNodes()) !== count($this->getNodes())) {
|
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())));
|
Log::debug(sprintf('Return false because node count is different. Original is %d, compare is %d', count($this->getNodes()), count($compare->getNodes())));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,6 +77,7 @@ abstract class Node
|
|||||||
foreach ($this->getNodes() as $index => $node) {
|
foreach ($this->getNodes() as $index => $node) {
|
||||||
if (false === $node->equals($compare->getNodes()[$index])) {
|
if (false === $node->equals($compare->getNodes()[$index])) {
|
||||||
Log::debug('Return false because nodes are different!');
|
Log::debug('Return false because nodes are different!');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -114,7 +114,7 @@ class AmountFormat extends AbstractExtension
|
|||||||
static function (string $amount, string $code, ?bool $coloured = null): string {
|
static function (string $amount, string $code, ?bool $coloured = null): string {
|
||||||
$coloured ??= true;
|
$coloured ??= true;
|
||||||
|
|
||||||
/** @var TransactionCurrency|null $currency */
|
/** @var null|TransactionCurrency $currency */
|
||||||
$currency = TransactionCurrency::whereCode($code)->first();
|
$currency = TransactionCurrency::whereCode($code)->first();
|
||||||
if (null === $currency) {
|
if (null === $currency) {
|
||||||
Log::error(sprintf('Could not find currency with code "%s". Fallback to native currency.', $code));
|
Log::error(sprintf('Could not find currency with code "%s". Fallback to native currency.', $code));
|
||||||
|
Reference in New Issue
Block a user