-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Description
Bug report
Phpstan does not seem to understand that there are only two implementations of DateTimeInterface.
The following code
public function __construct(\DateTimeInterface $date)
{
$this->date = $date instanceof \DateTimeImmutable ? $date : \DateTimeImmutable::createFromMutable($date);
}
results in wrong error
Parameter #1 $object of static method DateTimeImmutable::createFromMutable() expects DateTime, DateTimeInterface given.
Code snippet that reproduces the problem
Metadata
Metadata
Assignees
Labels
No labels