Remove unused methods.

This commit is contained in:
James Cole
2020-10-31 06:54:33 +01:00
parent 0104d46206
commit 55c8b9012c
2 changed files with 23 additions and 82 deletions

View File

@@ -29,9 +29,7 @@ use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Console\Command;
use Log;
@@ -53,30 +51,16 @@ class TransferCurrenciesCorrections extends Command
* @var string
*/
protected $signature = 'firefly-iii:transfer-currencies {--F|force : Force the execution of this command.}';
/** @var array */
private $accountCurrencies;
/** @var AccountRepositoryInterface */
private $accountRepos;
/** @var JournalCLIRepositoryInterface */
private $cliRepos;
/** @var int */
private $count;
/** @var CurrencyRepositoryInterface */
private $currencyRepos;
/** @var Account The destination account of the current journal. */
private $destinationAccount;
/** @var TransactionCurrency The currency preference of the destination account of the current journal. */
private $destinationCurrency;
/** @var Transaction The destination transaction of the current journal. */
private $destinationTransaction;
/** @var JournalRepositoryInterface */
private $journalRepos;
/** @var Account The source account of the current journal. */
private $sourceAccount;
/** @var TransactionCurrency The currency preference of the source account of the current journal. */
private $sourceCurrency;
/** @var Transaction The source transaction of the current journal. */
private $sourceTransaction;
private array $accountCurrencies;
private AccountRepositoryInterface $accountRepos;
private JournalCLIRepositoryInterface $cliRepos;
private int $count;
private Account $destinationAccount;
private TransactionCurrency $destinationCurrency;
private Transaction $destinationTransaction;
private Account $sourceAccount;
private TransactionCurrency $sourceCurrency;
private Transaction $sourceTransaction;
/**
@@ -502,8 +486,6 @@ class TransferCurrenciesCorrections extends Command
* For transfers, this is can be a destructive routine since we FORCE them into a currency setting whether they
* like it or not. Previous routines MUST have set the currency setting for both accounts for this to work.
*
* A transfer always has the
*
* Both source and destination must match the respective currency preference. So FF3 must verify ALL
* transactions.
*/
@@ -527,8 +509,6 @@ class TransferCurrenciesCorrections extends Command
{
$this->count = 0;
$this->accountRepos = app(AccountRepositoryInterface::class);
$this->currencyRepos = app(CurrencyRepositoryInterface::class);
$this->journalRepos = app(JournalRepositoryInterface::class);
$this->cliRepos = app(JournalCLIRepositoryInterface::class);
$this->accountCurrencies = [];
$this->resetInformation();

View File

@@ -248,32 +248,6 @@ class TransactionJournal extends Model
return $this->hasMany(TransactionJournalLink::class, 'destination_id');
}
/**
* @codeCoverageIgnore
* @return bool
*/
public function isDeposit(): bool
{
if (null !== $this->transaction_type_type) {
return TransactionType::DEPOSIT === $this->transaction_type_type;
}
return $this->transactionType->isDeposit();
}
/**
* @codeCoverageIgnore
* @return bool
*/
public function isOpeningBalance(): bool
{
if (null !== $this->transaction_type_type) {
return TransactionType::OPENING_BALANCE === $this->transaction_type_type;
}
return $this->transactionType->isOpeningBalance();
}
/**
* @codeCoverageIgnore
* @return bool
@@ -287,19 +261,6 @@ class TransactionJournal extends Model
return $this->transactionType->isTransfer();
}
/**
* @codeCoverageIgnore
* @return bool
*/
public function isWithdrawal(): bool
{
if (null !== $this->transaction_type_type) {
return TransactionType::WITHDRAWAL === $this->transaction_type_type;
}
return $this->transactionType->isWithdrawal();
}
/**
* @codeCoverageIgnore
* Get all of the notes.