-
-
Notifications
You must be signed in to change notification settings - Fork 946
Open
Labels
Milestone
Description
Bug report
I'm implementing custom rule that does
InClassNode->getClassReflection()->getNativeReflection()->getMethods()[each]->getAttributes(Whatever::class, ReflectionAttribute::IS_INSTANCEOF)which fails when analysing file similar to this:
class MyRuntimeException extends \RuntimeException {}getting error:
------ ----------------------------------------------------------------------------------------
Line MyRuntimeException.php
------ ----------------------------------------------------------------------------------------
5 Reflection error: JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
✏️ tests/src/ShipMonk/Exception/TestRuntimeException.php:5
------ ----------------------------------------------------------------------------------------
It looks like it is coming from vendor/phpstan/phpstan/phpstan.phar/vendor/jetbrains/phpstorm-stubs/Core/Core_c.stub:312 which contains
class Exception implements Throwable
{
#[PhpStormStubsElementAvailable("8.1")]
private function __clone(): void {}
}when better-reflection tries to reflect attribute class within ReflectionAttributeHelper::filterAttributesByInstance
Code snippet that reproduces the problem
No response
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable