From c65755725d777cf15c9a0a6fd66dc3a166ccafb3 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 15 Jun 2024 15:37:35 +0100 Subject: [PATCH] feat: improves type hinting with `@param-closure-this` --- src/Functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Functions.php b/src/Functions.php index 353b08c6..3f358bbc 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -54,6 +54,7 @@ if (! function_exists('beforeEach')) { /** * Runs the given closure before each test in the current file. * + * @param-closure-this TestCase $closure * @return HigherOrderTapProxy|Expectable|TestCall|TestCase|mixed */ function beforeEach(?Closure $closure = null): BeforeEachCall @@ -125,6 +126,7 @@ if (! function_exists('test')) { * is the test description; the second argument is * a closure that contains the test expectations. * + * @param-closure-this TestCase $closure * @return Expectable|TestCall|TestCase|mixed */ function test(?string $description = null, ?Closure $closure = null): HigherOrderTapProxy|TestCall @@ -145,6 +147,7 @@ if (! function_exists('it')) { * is the test description; the second argument is * a closure that contains the test expectations. * + * @param-closure-this TestCase $closure * @return Expectable|TestCall|TestCase|mixed */ function it(string $description, ?Closure $closure = null): TestCall @@ -180,6 +183,7 @@ if (! function_exists('afterEach')) { /** * Runs the given closure after each test in the current file. * + * @param-closure-this TestCase $closure * @return Expectable|HigherOrderTapProxy|TestCall|mixed */ function afterEach(?Closure $closure = null): AfterEachCall