psalm / psalm-plugin-doctrine

Stubs to let Psalm understand Doctrine better
86 stars 43 forks source link

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

Closed AndrolGenhald closed 2 years ago

AndrolGenhald commented 2 years ago

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

orklah commented 2 years ago

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

AndrolGenhald commented 2 years ago

Oh wow, yeah...

AndrolGenhald commented 2 years ago

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 commented 2 years ago

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

AndrolGenhald commented 2 years ago

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 commented 2 years ago

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

AndrolGenhald commented 2 years ago

@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.