From 5e1ddba72858be6d57401497c2ed477a6decbefb Mon Sep 17 00:00:00 2001 From: Choraimy Kroonstuiver <3661474+axlon@users.noreply.github.com> Date: Wed, 14 Aug 2024 19:17:37 +0200 Subject: [PATCH] Fix `foldLeft` and `foldRight` return types --- src/PhpOption/Option.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/PhpOption/Option.php b/src/PhpOption/Option.php index 91fab9c..b76e1b1 100644 --- a/src/PhpOption/Option.php +++ b/src/PhpOption/Option.php @@ -412,11 +412,12 @@ abstract public function reject($value); * ``` * * @template S + * @template R * * @param S $initialValue - * @param callable(S, T):S $callable + * @param callable(S, T):R $callable * - * @return S + * @return R */ abstract public function foldLeft($initialValue, $callable); @@ -424,11 +425,12 @@ abstract public function foldLeft($initialValue, $callable); * foldLeft() but with reversed arguments for the callable. * * @template S + * @template R * * @param S $initialValue - * @param callable(T, S):S $callable + * @param callable(T, S):R $callable * - * @return S + * @return R */ abstract public function foldRight($initialValue, $callable); }