The getWalletBalanceByType() method of the HasWallet trait requires a string parameter as wallet type and does checks wallet validity using WalletEnums::isValid($walletType) which also requires a string parameter, the isValid method of the WalletEnums enum checks the wallet vality by looping through self::cases() and checking for a match self::cases() is an array of WalletEnum case instances and not strings, meaning a match will never be found, this pull request fixes that by allowing the $type parameter to be either a string or an instance of WalletEnums and then checking if it's a string then converting it to the appropriete case using WalletEnums::from($type).
The
getWalletBalanceByType()
method of theHasWallet
trait requires a string parameter as wallet type and does checks wallet validity usingWalletEnums::isValid($walletType)
which also requires a string parameter, theisValid
method of theWalletEnums
enum checks the wallet vality by looping throughself::cases()
and checking for a matchself::cases()
is an array of WalletEnum case instances and not strings, meaning a match will never be found, this pull request fixes that by allowing the$type
parameter to be either a string or an instance of WalletEnums and then checking if it's a string then converting it to the appropriete case usingWalletEnums::from($type)
.