-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
See https://phpstan.org/r/98a3d03f-add8-407f-ac45-69ac58dbba7e
<?php declare(strict_types = 1);
interface FooInterface
{
/**
* @return static
*/
public function deserialize();
}
final class Foo implements FooInterface
{
public function deserialize(): self
{
return new self();
}
}Expected behavior:
No errors
Actual behavior:
I get the error
Return type (Foo) of method Foo::deserialize() should be covariant with return type (static(FooInterface)) of method FooInterface::deserialize()
Reactions are currently unavailable