Replace various enums

This commit is contained in:
James Cole
2022-04-13 14:39:13 +02:00
parent 9cfced1732
commit 089514908d
22 changed files with 87 additions and 69 deletions

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Insight;
use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@@ -73,7 +74,7 @@ class GenericRequest extends FormRequest
/** @var Account $account */
foreach ($this->accounts as $account) {
$type = $account->accountType->type;
if (in_array($type, [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE])) {
if (in_array($type, [AccountTypeEnum::ASSET, AccountTypeEnum::LOAN, AccountTypeEnum::DEBT, AccountTypeEnum::MORTGAGE])) {
$return->push($account);
}
}
@@ -220,7 +221,7 @@ class GenericRequest extends FormRequest
/** @var Account $account */
foreach ($this->accounts as $account) {
$type = $account->accountType->type;
if ($type === AccountType::EXPENSE) {
if ($type === AccountTypeEnum::EXPENSE) {
$return->push($account);
}
}
@@ -238,7 +239,7 @@ class GenericRequest extends FormRequest
/** @var Account $account */
foreach ($this->accounts as $account) {
$type = $account->accountType->type;
if ($type === AccountType::REVENUE) {
if ($type === AccountTypeEnum::REVENUE) {
$return->push($account);
}
}