mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Remove unnecessary setters.
This commit is contained in:
@@ -34,6 +34,7 @@ use FireflyIII\Models\Location;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -76,6 +77,7 @@ class AccountEnrichment implements EnrichmentInterface
|
||||
$this->notes = [];
|
||||
$this->lastActivities = [];
|
||||
$this->locations = [];
|
||||
$this->primaryCurrency = Amount::getPrimaryCurrency();
|
||||
// $this->repository = app(AccountRepositoryInterface::class);
|
||||
// $this->currencyRepository = app(CurrencyRepositoryInterface::class);
|
||||
// $this->start = null;
|
||||
@@ -281,11 +283,6 @@ class AccountEnrichment implements EnrichmentInterface
|
||||
});
|
||||
}
|
||||
|
||||
public function setPrimaryCurrency(TransactionCurrency $primary): void
|
||||
{
|
||||
$this->primaryCurrency = $primary;
|
||||
}
|
||||
|
||||
private function collectLastActivities(): void
|
||||
{
|
||||
$this->lastActivities = Steam::getLastActivities($this->accountIds);
|
||||
|
@@ -12,6 +12,7 @@ use FireflyIII\Models\ObjectGroup;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
|
||||
use FireflyIII\Support\Models\BillDateCalculator;
|
||||
@@ -38,6 +39,12 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
||||
private TransactionCurrency $primaryCurrency;
|
||||
private BillDateCalculator $calculator;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->convertToPrimary = Amount::convertToPrimary();
|
||||
$this->primaryCurrency = Amount::getPrimaryCurrency();
|
||||
}
|
||||
|
||||
public function enrich(Collection $collection): Collection
|
||||
{
|
||||
Log::debug(sprintf('%s(%s item(s))', __METHOD__, $collection->count()));
|
||||
@@ -140,16 +147,6 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
||||
$this->userGroup = $userGroup;
|
||||
}
|
||||
|
||||
public function setConvertToPrimary(bool $convertToPrimary): void
|
||||
{
|
||||
$this->convertToPrimary = $convertToPrimary;
|
||||
}
|
||||
|
||||
public function setPrimaryCurrency(TransactionCurrency $primaryCurrency): void
|
||||
{
|
||||
$this->primaryCurrency = $primaryCurrency;
|
||||
}
|
||||
|
||||
private function collectSubscriptionIds(): void
|
||||
{
|
||||
/** @var Bill $bill */
|
||||
|
Reference in New Issue
Block a user