-
-
Notifications
You must be signed in to change notification settings - Fork 27
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 AssertWpErrorTypeSpecifyingExtension
/ AssertNotWpErrorTypeSpecifyingExtension
#124
Conversation
…pecifyingExtension`
This might be possible with the new docblock-based assertions instead: https://phpstan.org/blog/phpstan-1-9-0-with-phpdoc-asserts-list-type |
Although that would mean bumping the minimum PHPStan requirement up to the latest. |
@johnbillion That would mean having to add the docblocks in core, right? |
I'm not a maintainer. |
...okay let's release v1.2.0 after this PR |
The https://github.com/php-stubs/wordpress-stubs/ library has a node visitor that allows additional tags to be added to the docblocks for function stubs, but AFAICT the methods in the test suite aren't generated as part of those stubs, so for now I think this type specifying extension makes the most sense actually 👍 |
Just marking as ready for review in the hopes of triggering tests to run... Can't get them to work locally somehow. |
CI does not start. |
@swissspidy There are 2 instances of --- Expected
+++ Actual
@@ @@
-'WP_Error'
+'int|WP_Error' |
Importing |
hey, I still have my phpstorm open from yesterday basically. I can quickly check if I see something :) |
Oh, did not expect this to be merged 😅 There's probably something silly I missed with these extensions. Again, I haven't been able to run the tests locally for some reason, so it was just copy & paste @herndlm Any help is much appreciated, thank you! |
Viktor's merge finger was too fast :) |
CI was not running in this PR Please continue in a new PR fixing this one. |
I think I figured it out, I'll open a PR explaining it |
Might need a bit of help with the implementation & tests, but I think this should cover the basics.
Fixes #30