mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Various issues fixed (SonarQube)
This commit is contained in:
@@ -275,7 +275,7 @@ trait RecurringTransactionTrait
|
||||
*/
|
||||
protected function updateTags(RecurrenceTransaction $transaction, array $tags): void
|
||||
{
|
||||
if (count($tags) > 0) {
|
||||
if (!empty($tags)) {
|
||||
/** @var RecurrenceMeta $entry */
|
||||
$entry = $transaction->recurrenceTransactionMeta()->where('name', 'tags')->first();
|
||||
if (null === $entry) {
|
||||
@@ -284,7 +284,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();
|
||||
}
|
||||
|
@@ -76,10 +76,6 @@ class JournalUpdateService
|
||||
private $transactionGroup;
|
||||
/** @var TransactionJournal The journal to update. */
|
||||
private $transactionJournal;
|
||||
/** @var Account If new account info is submitted, this array will hold the valid destination. */
|
||||
private $validDestination;
|
||||
/** @var Account If new account info is submitted, this array will hold the valid source. */
|
||||
private $validSource;
|
||||
|
||||
/**
|
||||
* JournalUpdateService constructor.
|
||||
|
@@ -41,8 +41,7 @@ class RecurrenceUpdateService
|
||||
{
|
||||
use TransactionTypeTrait, RecurringTransactionTrait;
|
||||
|
||||
/** @var User */
|
||||
private $user;
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* Updates a recurrence.
|
||||
@@ -99,7 +98,7 @@ class RecurrenceUpdateService
|
||||
$this->createRepetitions($recurrence, $data['repetitions'] ?? []);
|
||||
}
|
||||
|
||||
// update all transactions (and associated meta-data);
|
||||
// update all transactions (and associated meta-data)
|
||||
if (null !== $data['transactions']) {
|
||||
$this->deleteTransactions($recurrence);
|
||||
$this->createTransactions($recurrence, $data['transactions'] ?? []);
|
||||
|
Reference in New Issue
Block a user