From 2a87f46e626395232f84af3c260735452a965492 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 5 Feb 2020 23:44:00 +0100 Subject: [PATCH] Update tests. --- tests/src/BadCombinator.php | 5 +++++ tests/static-analysis/A.php | 2 +- tests/static-analysis/K.php | 2 +- tests/static-analysis/U.php | 2 +- tests/static-analysis/Y.php | 7 ++++--- tests/static-analysis/Z.php | 7 ++++--- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/src/BadCombinator.php b/tests/src/BadCombinator.php index 0f28a27..0b694ba 100644 --- a/tests/src/BadCombinator.php +++ b/tests/src/BadCombinator.php @@ -6,6 +6,11 @@ use loophp\combinator\Combinator; +/** + * Class BadCombinator. + * + * @psalm-immutable + */ class BadCombinator extends Combinator { } diff --git a/tests/static-analysis/A.php b/tests/static-analysis/A.php index 0e3c578..abed6dc 100644 --- a/tests/static-analysis/A.php +++ b/tests/static-analysis/A.php @@ -8,7 +8,7 @@ /** * @param callable(int): string $f - * @param string $x + * @param int $x * * @return string */ diff --git a/tests/static-analysis/K.php b/tests/static-analysis/K.php index faf13c4..13aaf6b 100644 --- a/tests/static-analysis/K.php +++ b/tests/static-analysis/K.php @@ -10,7 +10,7 @@ * @param string $x * @param int $y * - * @return int + * @return string */ function test($x, $y) { diff --git a/tests/static-analysis/U.php b/tests/static-analysis/U.php index 9a45a12..eeeda5f 100644 --- a/tests/static-analysis/U.php +++ b/tests/static-analysis/U.php @@ -7,7 +7,7 @@ use loophp\combinator\Combinator\U as Combinator; /** - * @param callable(int): mixed $f + * @param callable(callable):callable $f * @param callable(int): mixed $g * * @return mixed diff --git a/tests/static-analysis/Y.php b/tests/static-analysis/Y.php index 06b11d1..042ce34 100644 --- a/tests/static-analysis/Y.php +++ b/tests/static-analysis/Y.php @@ -4,14 +4,15 @@ namespace loophp\combinator\Tests\StaticAnalysis; +use Closure; use loophp\combinator\Combinator\Y as Combinator; /** - * @param callable(int): callable $f + * @param callable(callable): Closure $f * - * @return callable + * @return Closure */ -function test(callable $f) +function test(callable $f): Closure { return (new Combinator($f))(); } diff --git a/tests/static-analysis/Z.php b/tests/static-analysis/Z.php index 9237705..d538b82 100644 --- a/tests/static-analysis/Z.php +++ b/tests/static-analysis/Z.php @@ -4,14 +4,15 @@ namespace loophp\combinator\Tests\StaticAnalysis; +use Closure; use loophp\combinator\Combinator\Z as Combinator; /** - * @param callable(int): callable $f + * @param callable(callable): Closure $f * - * @return callable + * @return Closure */ -function test(callable $f) +function test(callable $f): Closure { return (new Combinator($f))(); }