You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php declare(strict_types=1);
namespace App;
use DateTimeInterface;
use Webmozart\Assert\Assert;
Assert::implementsInterface(\DateTime::class, DateTimeInterface::class);
Assert::implementsInterface(\DateTimeZone::class, DateTimeInterface::class);
Here is phpstan error:
Call to static method Webmozart\Assert\Assert::implementsInterface() with 'DateTime' and 'DateTimeInterface' will always evaluate to false.
Call to static method Webmozart\Assert\Assert::implementsInterface() with 'DateTimeZone' and 'DateTimeInterface' will always evaluate to false.
The text was updated successfully, but these errors were encountered:
The error is not with the FQN, the problem is that the phpstan implementation is interpreting the first parameter as an object and checks if implements the interface and comes to the conclusion that the string "DateTime" never implements a DateTimeInterface. This should be fixed by #16 .
The function implementsInterface($value, $interface, $message = '') from the docs
Here is the code:
Here is phpstan error:
The text was updated successfully, but these errors were encountered: