diff --git a/src/Casts/CurrencyCast.php b/src/Casts/CurrencyCast.php index 920b767..e191ad4 100644 --- a/src/Casts/CurrencyCast.php +++ b/src/Casts/CurrencyCast.php @@ -6,6 +6,10 @@ use Illuminate\Contracts\Database\Eloquent\CastsAttributes; use UnexpectedValueException; +/** + * @template TGet + * @template TSet + */ class CurrencyCast implements CastsAttributes { public function get($model, string $key, $value, array $attributes): Currency diff --git a/src/Casts/MoneyCast.php b/src/Casts/MoneyCast.php index 7286a7c..2ed636c 100644 --- a/src/Casts/MoneyCast.php +++ b/src/Casts/MoneyCast.php @@ -7,6 +7,10 @@ use Illuminate\Contracts\Database\Eloquent\CastsAttributes; use UnexpectedValueException; +/** + * @template TGet + * @template TSet + */ class MoneyCast implements CastsAttributes { public function get($model, string $key, $value, array $attributes): Money diff --git a/src/Rules/CurrencyRule.php b/src/Rules/CurrencyRule.php index fc79fde..3ced7a2 100644 --- a/src/Rules/CurrencyRule.php +++ b/src/Rules/CurrencyRule.php @@ -15,7 +15,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void } } - protected function passes($value): bool + protected function passes(mixed $value): bool { return is_string($value) && array_key_exists(strtoupper($value), Currency::getCurrencies()); }