mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Various code cleanup.
This commit is contained in:
@@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Services\FireflyIIIOrg\Update;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use JsonException;
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Models\Bill;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
use DB;
|
||||
use Exception;
|
||||
use FireflyIII\Models\Budget;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class BudgetDestroyService
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
use DB;
|
||||
use Exception;
|
||||
use FireflyIII\Models\Category;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class CategoryDestroyService
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class CurrencyDestroyService
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
use Exception;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceTransaction;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
|
||||
@@ -39,7 +39,6 @@ use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService;
|
||||
use JsonException;
|
||||
use Log;
|
||||
use Validator;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ use Exception;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
||||
@@ -262,7 +262,7 @@ class CreditRecalculateService
|
||||
// if it's a credit, we don't care, because sending more money
|
||||
// to a credit-liability doesn't increase the amount (yet)
|
||||
if (
|
||||
in_array($type, [TransactionType::WITHDRAWAL])
|
||||
$type === TransactionType::WITHDRAWAL
|
||||
&& (int)$account->id === (int)$transaction->account_id
|
||||
&& 1 === bccomp($transaction->amount, '0')
|
||||
&& 'credit' === $direction
|
||||
@@ -274,7 +274,7 @@ class CreditRecalculateService
|
||||
|
||||
// likewise deposit into a credit debt does not change the amount
|
||||
if (
|
||||
in_array($type, [TransactionType::DEPOSIT])
|
||||
$type === TransactionType::DEPOSIT
|
||||
&& (int)$account->id === (int)$transaction->account_id
|
||||
&& -1 === bccomp($transaction->amount, '0')
|
||||
&& 'credit' === $direction
|
||||
|
||||
@@ -79,7 +79,6 @@ class AccountUpdateService
|
||||
*
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function update(Account $account, array $data): Account
|
||||
{
|
||||
|
||||
@@ -122,6 +122,7 @@ class GroupUpdateService
|
||||
* @param array $transactions
|
||||
*
|
||||
* @return array
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array
|
||||
|
||||
Reference in New Issue
Block a user