-
-
Notifications
You must be signed in to change notification settings - Fork 947
Anonymous classes are not treated as final #7904
Copy link
Copy link
Closed
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels