-
Notifications
You must be signed in to change notification settings - Fork 17
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 support for Psalm v5 #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick glance and this looks good, lets get #41 merged and this PR updated and go from them there
e6e391a
to
3d2247a
Compare
@kkmuffme I would like your input on this. Even see your implementation. |
composer.json
Outdated
@@ -15,12 +15,12 @@ | |||
"php-stubs/wordpress-stubs": "^5.5", | |||
"php-stubs/wordpress-globals": "^0.2.0", | |||
"php-stubs/wp-cli-stubs": "^2.5", | |||
"vimeo/psalm": "^4" | |||
"vimeo/psalm": "^4 || ^5 || ^5@beta" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure of the feasability of this, but maybe we should try and configure GitHub Actions to test each version
Currently, vimeo/psalm (5.0.0-beta1)
is being installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I will change constraints for vimeo/psalm
to ^4.4 || ^.5
(since we switch from hooks to event handlers), I will switch psalm/plugin-phpunit
from dev-master
to ^0.17
and in the GitHub Actions workflow, I'll make Composer require Psalm 5.
These constraints will ensure Psalm v5 is installable. These constraints should be altered again when vimeo/psalm and psalm/plugin-phpunit are officially released.
In favour of its new Event Handlers.
Wrapped hook name in double quotes for easier reading.
3d2247a
to
a624f99
Compare
Refactored workflow to target PHP 7.4, 8.0, 8.1 and Psalm 4.x-dev or Psalm 5.x-dev.
The new workflow appears to work well but there's a breaking change introduced in Psalm 5 that will require either a breaking change for the plugin or some kind of conditional statement. The References: To preserve compatibility, we could use the |
a624f99
to
7a2cc15
Compare
My version of the plugin is 10 evolutions further already, making backporting all changes individually really hard/time consuming. I will only PR the full changeset now, bc I don't have time to waste either after this was abandoned for ages. Anyway regarding v5: I'd still prefer to move the plugin itself (and if this isn't possible, a fork of it) into the psalm github namespace, as this ensures long term compatibility and support - as long psalm is supported, there is the easy possibility to ensure that this plugin gets maintained too. |
I agree, what I think we need to ensure is just that, a v4 that we know as works in the v2.x.x branch, and then:
This new v5 Psalm release would be a major bump to a new release v3.x.x version Users would need to explicitly opt-in to v3.x.x |
@kkmuffme Hello, when you have an opportunity: could you create a branch to share your fork's changes? Alternatively, privately share me a copy or add me as a collaborator to your fork, and I can extract out what's needed for Psalm v5. Thanks. |
Yes, sorry, I was really busy with other stuff. Atm php-parser is changing (since it's changing to v5 soon) and psalm is updating for that (as per PR vimeo/psalm@3e54feb) which should release with psalm 5.14.0 soon. In the meantime I have fixed an issue psalm had with stubs, where the assumed type often lead to errors that made no sense: vimeo/psalm#9992
Could you PR this perhaps, so we can merge that already in the next week. |
Is there any list of outstanding work needed to complete this? |
Really sorry, didn't have time bc of family the last months. It's ready actually - atm there is a pending PR to be merged by me in core vimeo/psalm#10370 which fixes tons of false negative/false positive errors that are especially relevant for WP/this plugin. I will PR the new version of this plugin this week and release it beginning of next week with the next psalm core version. |
Awesome, thank you! And I certainly don't mean to rush you. I know it's the holiday season, and totally understandable to have a lot going on with family. Just seeing if I could help out in any way. Sounds like you have everything just about ready. 👍❤️ |
My PR is ready for testing #49 |
Closing in favour of #49. |
This pull request continues what was started in #41 and should be merged first.
Currently, the dependency constraints target vimeo/psalm
^5@beta
and psalm/plugin-phpunitdev-master
.Fixed errors and warnings raised by Psalm.
@kkmuffme has mentioned they also have a Psalm v5 ready fork of this plugin, which I was not aware of when I started my version. I'm sharing my implementation for reference and can be replaced by theirs.