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

Make Collector return type more explicit #458

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

staabm
Copy link

@staabm staabm commented Sep 16, 2024

while the previous return type was correct, it did not explicitly state/protect you from someone changing the collector and make it return a empty array.

thats a major problem which can happen, and I want to make sure this error will not bite you, like it did in my projects.

for in-detail context see phpstan/phpstan#11701 (comment)

@staabm
Copy link
Author

staabm commented Sep 16, 2024

I did not apply the fix to all collector classes in this repo - but I think you get the point and can do the rest on your own.

if you have any questions left, feel free to ask.

I am not a phpstan-latte user myself, therefore I did not take care of making this thing perfect. My primary motivation was to make sure people don't shoot their own feet because of problems with Collectors

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.

1 participant