From 639b1b94a318f9540df916bd0be075203096e29a Mon Sep 17 00:00:00 2001 From: orklah Date: Mon, 20 Dec 2021 09:57:06 +0100 Subject: [PATCH] fix stub and fix test --- stubs/Reflection.phpstub | 2 +- tests/AttributeTest.php | 25 +++++++------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/stubs/Reflection.phpstub b/stubs/Reflection.phpstub index 8cb358f8e03..dfe6950b81f 100644 --- a/stubs/Reflection.phpstub +++ b/stubs/Reflection.phpstub @@ -51,7 +51,7 @@ class ReflectionClass implements Reflector { * @since 8.0 * @template TClass as object * @param class-string|null $name - * @return (TClass is object ? array> : array>) + * @return ($name is null ? array> : array>) */ public function getAttributes(?string $name = null, int $flags = 0): array {} } diff --git a/tests/AttributeTest.php b/tests/AttributeTest.php index 513c4b932fd..25a8b1bcddd 100644 --- a/tests/AttributeTest.php +++ b/tests/AttributeTest.php @@ -104,26 +104,15 @@ function foo(string $s) : void { ], 'testReflectingAllAttributes' => [ 'getAttributes(); - scope($b); - } - } - - /** @param array> $_a */ - function scope($_a):void{ - - } + $a = new ReflectionClass($cs); + $b = $a->getAttributes(); ', - [], + 'assertions' => [ + '$b' => 'array>', + ], [], '8.0' ],