Replace enum

This commit is contained in:
James Cole
2025-01-03 09:09:15 +01:00
parent d009ce31ca
commit 36351a5dd9
36 changed files with 68 additions and 67 deletions

View File

@@ -343,7 +343,7 @@ class CreditRecalculateService
}
// in any other case, remove amount from left of debt.
if (in_array($type, [TransactionTypeEnum::WITHDRAWAL->value, TransactionType::DEPOSIT, TransactionTypeEnum::TRANSFER->value], true)) {
if (in_array($type, [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::TRANSFER->value], true)) {
$usedAmount = app('steam')->negative($usedAmount);
return bcadd($leftOfDebt, $usedAmount);
@@ -412,7 +412,7 @@ class CreditRecalculateService
*/
private function isDepositOut(string $amount, string $transactionType): bool
{
return TransactionType::DEPOSIT === $transactionType && -1 === bccomp($amount, '0');
return TransactionTypeEnum::DEPOSIT->value === $transactionType && -1 === bccomp($amount, '0');
}
/**
@@ -423,7 +423,7 @@ class CreditRecalculateService
*/
private function isDepositIn(string $amount, string $transactionType): bool
{
return TransactionType::DEPOSIT === $transactionType && 1 === bccomp($amount, '0');
return TransactionTypeEnum::DEPOSIT->value === $transactionType && 1 === bccomp($amount, '0');
}
/**