mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various code cleanup.
This commit is contained in:
@@ -155,9 +155,7 @@ trait AccountServiceTrait
|
||||
{
|
||||
$dbNote = $account->notes()->first();
|
||||
if ('' === $note) {
|
||||
if (null !== $dbNote) {
|
||||
$dbNote->delete();
|
||||
}
|
||||
$dbNote?->delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -342,7 +340,6 @@ trait AccountServiceTrait
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
protected function getCurrency(int $currencyId, string $currencyCode): TransactionCurrency
|
||||
{
|
||||
@@ -377,7 +374,7 @@ trait AccountServiceTrait
|
||||
|
||||
throw new FireflyException('Amount for update liability credit/debit was unexpectedly 0.');
|
||||
}
|
||||
// if direction is "debit" (i owe this debt), amount is negative.
|
||||
// if direction is "debit" (I owe this debt), amount is negative.
|
||||
// which means the liability will have a negative balance which the user must fill.
|
||||
$openingBalance = app('steam')->negative($openingBalance);
|
||||
|
||||
|
@@ -56,9 +56,7 @@ trait BillServiceTrait
|
||||
{
|
||||
if ('' === $note) {
|
||||
$dbNote = $bill->notes()->first();
|
||||
if (null !== $dbNote) {
|
||||
$dbNote->delete();
|
||||
}
|
||||
$dbNote?->delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -39,6 +39,7 @@ use FireflyIII\Rules\UniqueIban;
|
||||
use FireflyIII\Support\NullArrayObject;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use Safe\Exceptions\JsonException;
|
||||
use function Safe\json_encode;
|
||||
|
||||
/**
|
||||
@@ -265,7 +266,13 @@ trait JournalServiceTrait
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account|null $account
|
||||
* @param array $data
|
||||
* @param string $preferredType
|
||||
*
|
||||
* @return Account|null
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function createAccount(?Account $account, array $data, string $preferredType): ?Account
|
||||
{
|
||||
|
@@ -54,9 +54,7 @@ trait RecurringTransactionTrait
|
||||
{
|
||||
if ('' === $note) {
|
||||
$dbNote = $recurrence->notes()->first();
|
||||
if (null !== $dbNote) {
|
||||
$dbNote->delete();
|
||||
}
|
||||
$dbNote?->delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -285,7 +285,6 @@ class AccountUpdateService
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function updatePreferences(Account $account): void
|
||||
{
|
||||
|
@@ -47,7 +47,6 @@ class BillUpdateService
|
||||
protected User $user;
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function update(Bill $bill, array $data): Bill
|
||||
{
|
||||
|
@@ -139,9 +139,7 @@ class CategoryUpdateService
|
||||
}
|
||||
if ('' === $note) {
|
||||
$dbNote = $category->notes()->first();
|
||||
if (null !== $dbNote) {
|
||||
$dbNote->delete();
|
||||
}
|
||||
$dbNote?->delete();
|
||||
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user