From 6de257e066f7193b077564a56e3eb9f57faf505b Mon Sep 17 00:00:00 2001 From: Faissal Wahabali Date: Tue, 4 Jun 2024 14:31:20 +0100 Subject: [PATCH] [10.x] Turn `Enumerable unless()` $callback parameter optional (#51701) * turn Enumerable unless() parameter optional * nullable parameters declaration --- src/Illuminate/Collections/Enumerable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Collections/Enumerable.php b/src/Illuminate/Collections/Enumerable.php index 918f64758e66..c9fb24fa1fac 100644 --- a/src/Illuminate/Collections/Enumerable.php +++ b/src/Illuminate/Collections/Enumerable.php @@ -338,11 +338,11 @@ public function whenNotEmpty(callable $callback, callable $default = null); * @template TUnlessReturnType * * @param bool $value - * @param (callable($this): TUnlessReturnType) $callback + * @param (callable($this): TUnlessReturnType)|null $callback * @param (callable($this): TUnlessReturnType)|null $default * @return $this|TUnlessReturnType */ - public function unless($value, callable $callback, callable $default = null); + public function unless($value, ?callable $callback = null, ?callable $default = null); /** * Apply the callback unless the collection is empty.