-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
0.12.64 (Also https://phpstan.org/)
I get the following error on the $class::values(); line.
Static call to instance method stdClass::values().
Code snippet that reproduces the problem
<?php declare(strict_types = 1);
class Test
{
/**
* @template T
* @psalm-param class-string<T> $class
*/
public static function valuesOf(string $class): void
{
(new $class())->values(); // No error
assert(method_exists($class, 'values')); // No effect
$class::values(); // Error
}
}https://phpstan.org/r/020e6a92-b651-41a1-9c6d-6992da1b35b5
Expected output
I expect to get no errors.
Why is it recognized as stdClass and why do I get an error?
Also, is there a workaround?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels