diff --git a/tests/phpunit/event/HandlerListManagerTest.php b/tests/phpunit/event/HandlerListManagerTest.php index bf35bf2dc..01de9ff84 100644 --- a/tests/phpunit/event/HandlerListManagerTest.php +++ b/tests/phpunit/event/HandlerListManagerTest.php @@ -40,6 +40,10 @@ class HandlerListManagerTest extends TestCase{ $this->resolveParentFunc = (new \ReflectionMethod(HandlerListManager::class, 'resolveNearestHandleableParent'))->getClosure(); } + /** + * @return \Generator|mixed[][] + * @phpstan-return \Generator, bool, string}, void, void> + */ public function isValidClassProvider() : \Generator{ yield [new \ReflectionClass(Event::class), false, "event base should not be handleable"]; yield [new \ReflectionClass(TestConcreteEvent::class), true, ""]; @@ -53,11 +57,16 @@ class HandlerListManagerTest extends TestCase{ * @param \ReflectionClass $class * @param bool $isValid * @param string $reason + * @phpstan-param \ReflectionClass $class */ public function testIsValidClass(\ReflectionClass $class, bool $isValid, string $reason) : void{ self::assertSame($isValid, ($this->isValidFunc)($class), $reason); } + /** + * @return \Generator|\ReflectionClass[][] + * @phpstan-return \Generator, \ReflectionClass|null}, void, void> + */ public function resolveParentClassProvider() : \Generator{ yield [new \ReflectionClass(TestConcreteExtendsAllowHandleEvent::class), new \ReflectionClass(TestAbstractAllowHandleEvent::class)]; yield [new \ReflectionClass(TestConcreteEvent::class), null]; @@ -70,6 +79,8 @@ class HandlerListManagerTest extends TestCase{ * * @param \ReflectionClass $class * @param \ReflectionClass|null $expect + * @phpstan-param \ReflectionClass $class + * @phpstan-param \ReflectionClass|null $expect */ public function testResolveParentClass(\ReflectionClass $class, ?\ReflectionClass $expect) : void{ if($expect === null){ diff --git a/tests/phpunit/plugin/ApiVersionTest.php b/tests/phpunit/plugin/ApiVersionTest.php index 236b5b2c9..c6d8d3743 100644 --- a/tests/phpunit/plugin/ApiVersionTest.php +++ b/tests/phpunit/plugin/ApiVersionTest.php @@ -27,6 +27,10 @@ use PHPUnit\Framework\TestCase; class ApiVersionTest extends TestCase{ + /** + * @return \Generator|mixed[][] + * @phpstan-return \Generator + */ public function compatibleApiProvider() : \Generator{ yield ["3.0.0", "3.0.0", true]; yield ["3.1.0", "3.0.0", true]; @@ -53,6 +57,10 @@ class ApiVersionTest extends TestCase{ self::assertSame($expected, ApiVersion::isCompatible($myVersion, [$wantVersion]), "my version: $myVersion, their version: $wantVersion, expect " . ($expected ? "yes" : "no")); } + /** + * @return mixed[][][] + * @phpstan-return \Generator, list}, void, void> + */ public function ambiguousVersionsProvider() : \Generator{ yield [["3.0.0"], []]; yield [["3.0.0", "3.0.1"], ["3.0.0", "3.0.1"]];