Bug report
Given this only surfaces on PHPStan 2.1.2, and only on PHP 8.4, I'm guessing it's a non-obvious side-effect of #12435, but I didn't dig into it too deeply.
At any rate, I'm seeing this on all of my PHPUnit tests that return ReflectionClass, and I don't think the way they're annotated is problematic?
Code for convenience:
<?php declare(strict_types=1);
class MyTest
{
/**
* @return array<array{ReflectionClass<object>}>
*/
public static function myProvider(): array
{
return [
[
new ReflectionClass(MyTest::class),
],
];
}
}
Code snippet that reproduces the problem
https://phpstan.org/r/a3a788e2-e5dd-4d7d-997f-90cd344dc695
Expected output
No errors should be reported here.
Did PHPStan help you today? Did it make you happy in any way?
No response