mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 13:10:35 +00:00
Various code cleanup.
This commit is contained in:
@@ -67,7 +67,7 @@ class CreditRecalculateService
|
||||
// work based on account.
|
||||
$this->processAccount();
|
||||
}
|
||||
if (0 === count($this->work)) {
|
||||
if (empty($this->work)) {
|
||||
Log::debug('No work accounts, do not do CreditRecalculationService');
|
||||
|
||||
return;
|
||||
@@ -127,7 +127,7 @@ class CreditRecalculateService
|
||||
{
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($this->group->transactionJournals as $journal) {
|
||||
if (0 === count($this->work)) {
|
||||
if (empty($this->work)) {
|
||||
try {
|
||||
$this->findByJournal($journal);
|
||||
} catch (FireflyException $e) {
|
||||
|
||||
@@ -322,7 +322,7 @@ trait RecurringTransactionTrait
|
||||
$entry->value = json_encode($tags);
|
||||
$entry->save();
|
||||
}
|
||||
if (0 === count($tags)) {
|
||||
if (empty($tags)) {
|
||||
// delete if present
|
||||
$transaction->recurrenceTransactionMeta()->where('name', 'tags')->delete();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class GroupUpdateService
|
||||
$transactionGroup->save();
|
||||
}
|
||||
|
||||
if (0 === count($transactions)) {
|
||||
if (empty($transactions)) {
|
||||
Log::debug('No transactions submitted, do nothing.');
|
||||
|
||||
return $transactionGroup;
|
||||
|
||||
@@ -149,7 +149,7 @@ class RecurrenceUpdateService
|
||||
private function updateRepetitions(Recurrence $recurrence, array $repetitions): void
|
||||
{
|
||||
$originalCount = $recurrence->recurrenceRepetitions()->count();
|
||||
if (0 === count($repetitions)) {
|
||||
if (empty($repetitions)) {
|
||||
// wont drop repetition, rather avoid.
|
||||
return;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ class RecurrenceUpdateService
|
||||
private function updateTransactions(Recurrence $recurrence, array $transactions): void
|
||||
{
|
||||
$originalCount = $recurrence->recurrenceTransactions()->count();
|
||||
if (0 === count($transactions)) {
|
||||
if (empty($transactions)) {
|
||||
// wont drop transactions, rather avoid.
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user