Replies: 2 comments 1 reply
-
|
I guess I can just work around it by writing it as $dates = array_filter(
array_map(
/* fn (): ?DateTime => ... */,
$source
)
);
if ([] === $dates) {
return null;
}
return min($dates);But I am curious how to handle the error PHPStan throws in the playground example. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Please open a bug report about it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So I have a situation where my return value can be either
nullor the lowest value of list ofDateTimeinstances. But PHPStan does not seem to like this approach and I am not entirely sure why?https://phpstan.org/r/81dc22e3-fae8-4f8c-b8b0-d147bff46950
Beta Was this translation helpful? Give feedback.
All reactions