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' ],