Fix various phpstan issues.

This commit is contained in:
James Cole
2025-01-03 14:56:06 +01:00
parent a8ae496fda
commit 394d0eabef
42 changed files with 133 additions and 181 deletions

View File

@@ -59,7 +59,7 @@ class BillTransformer extends AbstractTransformer
*/
public function transform(Bill $bill): array
{
$defaultCurrency = $this->parameters->get('defaultCurrency') ?? Amount::getDefaultCurrency();
$defaultCurrency = $this->parameters->get('defaultCurrency') ?? app('amount')->getDefaultCurrency();
$paidData = $this->paidData($bill);
$lastPaidDate = $this->getLastPaidDate($paidData);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Transformers;
use FireflyIII\Enums\AutoBudgetType;
use FireflyIII\Models\AutoBudget;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
@@ -71,9 +72,9 @@ class BudgetTransformer extends AbstractTransformer
$notes = $this->repository->getNoteText($budget);
$types = [
AutoBudget::AUTO_BUDGET_RESET => 'reset',
AutoBudget::AUTO_BUDGET_ROLLOVER => 'rollover',
AutoBudget::AUTO_BUDGET_ADJUSTED => 'adjusted',
AutoBudgetType::AUTO_BUDGET_RESET->value => 'reset',
AutoBudgetType::AUTO_BUDGET_ROLLOVER->value => 'rollover',
AutoBudgetType::AUTO_BUDGET_ADJUSTED->value => 'adjusted',
];
if (null !== $autoBudget) {

View File

@@ -48,6 +48,7 @@ class AccountTransformer extends AbstractTransformer
private array $fullTypes;
private array $lastActivity;
private array $objectGroups;
private array $balances;
/**
* This method collects meta-data for one or all accounts in the transformer's collection.
@@ -55,6 +56,7 @@ class AccountTransformer extends AbstractTransformer
public function collectMetaData(Collection $objects): Collection
{
$this->currencies = [];
$this->balances = [];
$this->accountMeta = [];
$this->accountTypes = [];
$this->fullTypes = [];

View File

@@ -56,10 +56,10 @@ class TransactionGroupTransformer extends AbstractTransformer
// private array $currencies = [];
// private array $transactionTypes = [];
// private array $meta = [];
// private array $notes = [];
private array $meta = [];
private array $notes = [];
// private array $locations = [];
// private array $tags = [];
private array $tags = [];
// private array $amounts = [];
// private array $foreignAmounts = [];
// private array $journalCurrencies = [];