From 8ee6742298310522396a2d789eb442c2f7b40cd7 Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Thu, 3 Oct 2024 14:59:46 -0300 Subject: [PATCH] Default value true is true when hydrating from keys --- src/Concerns/Hydrates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Concerns/Hydrates.php b/src/Concerns/Hydrates.php index 630ad12..4aedfc1 100644 --- a/src/Concerns/Hydrates.php +++ b/src/Concerns/Hydrates.php @@ -65,7 +65,7 @@ public static function tryFrom(string $name): ?static * @return CasesCollection * @throws ValueError */ - public static function fromKey(callable|string $key, mixed $value): CasesCollection + public static function fromKey(callable|string $key, mixed $value = true): CasesCollection { if ($cases = self::tryFromKey($key, $value)) { return $cases; @@ -82,7 +82,7 @@ public static function fromKey(callable|string $key, mixed $value): CasesCollect * @param (callable(self): mixed)|string $key * @return ?CasesCollection */ - public static function tryFromKey(callable|string $key, mixed $value): ?CasesCollection + public static function tryFromKey(callable|string $key, mixed $value = true): ?CasesCollection { $cases = [];