Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null to docblock of minimum and maximum. #210

Closed
wants to merge 1 commit into from

Conversation

jasonmm
Copy link
Contributor

@jasonmm jasonmm commented Dec 22, 2019

The minimum and maximum functions can return null if the $collection is empty. This commit adds to their @return annotation that a null return is a possibility.

I'm not sure if this relates to #208, but psalm does report handling the possibility of a null return with DocblockTypeContradiction.

For example, maximum([]) ?? -1 will produce a DocblockTypeContradiction.

The `minimum` and `maximum` functions can return null if the $collection
is empty. This commit adds to their @return annotation that a null return
is a possibility.
@lstrojny
Copy link
Owner

I am currently adding psalm support (see #208). Since you seem to be using psalm and in case you are interested, feel free to check the psalm branch and report any issue you might encounter.
I’ll leave this PR open for the time being to not create conflicts with the psalm work.

@jasonmm
Copy link
Contributor Author

jasonmm commented Dec 22, 2019

@lstrojny, would it be helpful if I were to make this pull request against the psalm branch?

@lstrojny
Copy link
Owner

lstrojny commented Jan 2, 2020

@jasonmm sure, that would be awesome. In this case though, minimum and maximum are correct in psalm already.

Base automatically changed from master to main March 5, 2021 16:00
@jasonmm
Copy link
Contributor Author

jasonmm commented Oct 14, 2021

This pull request is no longer applicable.

@jasonmm jasonmm closed this Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants