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

Improve Collection ::first() and ::last() return type provider. #119

Conversation

AndrolGenhald
Copy link
Contributor

Infer non-empty when Collection::add() has been called, and make provider work for properties as well as variables.

@orklah
Copy link
Collaborator

orklah commented Jul 11, 2022

looks like we're gonna have to fix the CI first...

@AndrolGenhald
Copy link
Contributor Author

Oh wow, yeah...

@AndrolGenhald
Copy link
Contributor Author

Well this is great, phpstan/phpdoc-parser had a backward incompatible change that broke slevomat/coding-standard (slevomat/coding-standard#1379), and doctrine/coding-standard relies on slevomat/coding-standard ^7.0.0. doctrine/coding-standard 9.0.x updates that to ^8, but there hasn't been a release with that yet, so I'm not sure what to do about it... It's currently impossible to run phpcs without crashing.

@orklah
Copy link
Collaborator

orklah commented Jul 11, 2022

Can we pin the version of phpstan/phpdoc-parser to one that doesn't fail?

@AndrolGenhald
Copy link
Contributor Author

When I run composer update --prefer-dist --no-interaction --prefer-stable --prefer-lowest I get different dependencies and the tests run fine, not sure why it's different yet.

@muglug
Copy link
Member

muglug commented Jul 12, 2022

I guess remove the doctrine/coding-standard req until things stabilise?

@AndrolGenhald
Copy link
Contributor Author

@orklah's suggestion to pin phpstan/phpdoc-parser fixed that one, but I opened a separate pull for that (#120) so it would be clear that it's a requirement that's not needed and can be removed in the future. Not sure what's going on with the low deps tests though.

@AndrolGenhald AndrolGenhald force-pushed the improve-collection-first-last-return-type-provider branch from 7595746 to 2df7c85 Compare July 19, 2022 19:21
@AndrolGenhald AndrolGenhald merged commit 59707fb into psalm:2.x Jul 19, 2022
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.

None yet

3 participants