Bug report
See https://phpstan.org/r/4b34db49-bd87-40db-a8c0-8a37a4bbc933
Expected Behavior:
PHPStan should recognize the conditions performed are valid, thus not raising any errors.
Actual Behavior:
PHPStan reports a Cannot call method format() on DateTime|null., even though valid condition checks are in place.
Code snippet that reproduces the problem
https://phpstan.org/r/4b34db49-bd87-40db-a8c0-8a37a4bbc933
Expected output
PHPStan shouldn't report an issue for these cases
Did PHPStan help you today? Did it make you happy in any way?
I absolutely love PHPStan. PHPStan keeps my code clean and free of bugs, so it keeps my head sane :).