diff --git a/src/Collect/Support/Traits/EnumeratesValues.php b/src/Collect/Support/Traits/EnumeratesValues.php index 4fe41f7..b29ab2f 100644 --- a/src/Collect/Support/Traits/EnumeratesValues.php +++ b/src/Collect/Support/Traits/EnumeratesValues.php @@ -159,7 +159,7 @@ public static function empty() * @param (callable(int): TTimesValue)|null $callback * @return static<int, TTimesValue> */ - public static function times($number, callable $callback = null) + public static function times($number, ?callable $callback = null) { if ($number < 1) { return new static; @@ -479,7 +479,7 @@ public function sum($callback = null) * @param (callable($this): TWhenEmptyReturnType)|null $default * @return $this|TWhenEmptyReturnType */ - public function whenEmpty(callable $callback, callable $default = null) + public function whenEmpty(callable $callback, ?callable $default = null) { return $this->when($this->isEmpty(), $callback, $default); } @@ -493,7 +493,7 @@ public function whenEmpty(callable $callback, callable $default = null) * @param (callable($this): TWhenNotEmptyReturnType)|null $default * @return $this|TWhenNotEmptyReturnType */ - public function whenNotEmpty(callable $callback, callable $default = null) + public function whenNotEmpty(callable $callback, ?callable $default = null) { return $this->when($this->isNotEmpty(), $callback, $default); } @@ -507,7 +507,7 @@ public function whenNotEmpty(callable $callback, callable $default = null) * @param (callable($this): TUnlessEmptyReturnType)|null $default * @return $this|TUnlessEmptyReturnType */ - public function unlessEmpty(callable $callback, callable $default = null) + public function unlessEmpty(callable $callback, ?callable $default = null) { return $this->whenNotEmpty($callback, $default); } @@ -521,7 +521,7 @@ public function unlessEmpty(callable $callback, callable $default = null) * @param (callable($this): TUnlessNotEmptyReturnType)|null $default * @return $this|TUnlessNotEmptyReturnType */ - public function unlessNotEmpty(callable $callback, callable $default = null) + public function unlessNotEmpty(callable $callback, ?callable $default = null) { return $this->whenEmpty($callback, $default); }