-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#4789Description
Bug report
PHPStan no longer understands the types when iterating over a DatePeriod object.
function (\DatePeriod $p) {
foreach ($p as $dt) {
assertType('DateTimeInterface', $dt); // PHPStan currently identifies $dt as mixed
}
};I've bisected and identified phpstan/phpstan-src@4a143bd (phpstan/phpstan-src#4761) as the cause reverting this commit on the latest 2.1.x branch fixes the problem.
Code snippet that reproduces the problem
https://phpstan.org/r/ac78effb-a5c3-4c5c-b54c-4c7b67ee4a57
Expected output
No error should be detected.
Did PHPStan help you today? Did it make you happy in any way?
My PHPStan 🐘 looks swell on my desk.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels