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

psalm phpstan extension #2223

Closed
staabm opened this issue Jun 18, 2019 · 6 comments
Closed

psalm phpstan extension #2223

staabm opened this issue Jun 18, 2019 · 6 comments

Comments

@staabm
Copy link
Contributor

staabm commented Jun 18, 2019

Some well known open source libraries start to add psalm specific annotations to their codebase to support advanced analysis features.

see e.g.
sebastianbergmann/phpunit#3708
Ocramius/ProxyManager#465
Ocramius/PackageVersions#89

would it make sense to have a phpstan-psalm-extension which allows phpstan to pickup the psalm-specific annotations and use this information while analysis?

I wouldn't expect that phpstan supports all the things psalm already has, but maybe there is some low hanging fruit which can help phpstan to do a more detailed/more informed analysis..?

@ondrejmirtes
Copy link
Member

ondrejmirtes commented Jun 18, 2019 via email

@ondrejmirtes
Copy link
Member

ondrejmirtes commented Jun 18, 2019 via email

@staabm
Copy link
Contributor Author

staabm commented Jun 18, 2019

Generics support in PHPStan will read Psalm-specific annotations. No other plans currently. It would be better to have some kind of standard instead of vendor prefixes...

I totally agree to have a generic standard would be best in the long or mid term.
forming/formulating such standards often takes a long amount of time, therefore I figured it might make sense to pickup the psalm-specific ones in the meantime.

BTW2 PHPUnit’s typing in PHPStan today is supported with

this is correct, but having the psalm specific annotations work as a psalm-extension would open the door to all libraries which use them - without the need for a specific phpstan extension avaiable.

@muglug
Copy link
Contributor

muglug commented Jun 19, 2019

Here's a list I just put together of Psalm's supported assertions: https://psalm.dev/docs/annotating_code/assertion_syntax/

@staabm
Copy link
Contributor Author

staabm commented Jun 1, 2022

Will close, as there is not actionable thing here and we recently implemented some of tge mentioned psalm features

@staabm staabm closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2022
@github-actions
Copy link

github-actions bot commented Jul 3, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants