Skip to content

Commit c75e568

Browse files
committed
Refactor balance handling in Wallet model
- Simplified the conversion of the available balance to a string by removing the conditional check for string type. - Ensured consistent type casting for better clarity and maintainability.
1 parent 22046a8 commit c75e568

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/Wallet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function refreshBalance(): bool
144144
/** @var float|int|non-empty-string $balanceRaw */
145145
$balanceRaw = $this->getAvailableBalanceAttribute();
146146
/** @var non-empty-string $balance */
147-
$balance = is_string($balanceRaw) ? $balanceRaw : (string) $balanceRaw;
147+
$balance = (string) $balanceRaw;
148148
if (app(MathServiceInterface::class)->compare($whatIs, $balance) === 0) {
149149
return true;
150150
}

0 commit comments

Comments
 (0)