Bug report
PHPStan should treat anonymous classes as final.
Code snippet that reproduces the problem
interface Test {
public static function create(): static;
}
$impl = new class implements Test {
public static function create(): static {
return new self();
}
};
https://phpstan.org/r/9c7e89f4-0572-4bc8-b5ad-374c6f73071e
Method class@anonymous/tmp.php:7::create() should return static(class@anonymous/tmp.php:7) but returns class@anonymous/tmp.php:7.
Expected output
No issues reported by PHPStan.
Bug report
PHPStan should treat anonymous classes as
final.Code snippet that reproduces the problem
https://phpstan.org/r/9c7e89f4-0572-4bc8-b5ad-374c6f73071e
Expected output
No issues reported by PHPStan.