Namespaces, deprecated and scheduled hooks, performance,...#23
Open
kkmuffme wants to merge 1 commit intowp-hooks:trunkfrom
Open
Namespaces, deprecated and scheduled hooks, performance,...#23kkmuffme wants to merge 1 commit intowp-hooks:trunkfrom
kkmuffme wants to merge 1 commit intowp-hooks:trunkfrom
Conversation
Fix wp-hooks#17 Add full support for namespaces and use statements Fix wp-hooks#9 (replaces wp-hooks#11) Add (back/again?) deprecated hooks Restore dynamic hook name printing as it was pre <1.0.0, since the format was more useful/general - reused my code of psalm/psalm-plugin-wordpress (atm it's slightly different there bc I didn't have time to update it yet) Massively speed up processing by skipping ignored files earlier (mostly relevant for plugins) Speed up processing by skipping files that do not contain any filters/actions (mostly relevant for plugins) Restore error output to stderr instead of stdout which I previously already fix in <1.0.0 and consistently write errors to stderr everywhere Exclude fully dynamic, variable only hooks, since they only lead to false positive in tooling (aligns with psalm-plugin-wordpress) Add additional errors Use @return as param if it's the only annotated tag Various code style fix to make more aligned with WP code style
Member
|
Thanks for the PR @kkmuffme. I'm happy for this to go in as long as the generated output is backwards-compatible, which it seems is it. I've invited you to be a maintainer of this repo as I've seen your work on PHPStan and other static analysis tools so I trust you. This means you'll be able to merge PRs, tag, publish releases, etc. Feel free to accept or ignore as you wish :) |
Collaborator
Author
|
Thank you. |
Member
|
Let me know if and when you create any Trac tickets, I can always take a look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry for this massive PR, I initially intended to submit it separately, but then more and more changes accumulated as we used it internally and I never found the time to PR it.
Before these fixes might never get upstreamed/lost, I thought I PR most of it now at once. (the biggest code chunks added are just copies (with slight updates) of what I implemented in either psalm-plugin-wordpress or php stubs-generator packages already a long time ago)
Fix #17
Add full support for namespaces and use statements
Fix #9 (replaces #11)
Add (back/again?) deprecated hooks
Restore dynamic hook name printing as it was pre <1.0.0, since the format was more useful/general - reused my code of psalm/psalm-plugin-wordpress (atm it's slightly different there bc I didn't have time to update it yet)
Massively speed up processing by skipping ignored files earlier (mostly relevant for plugins)
Speed up processing by skipping files that do not contain any filters/actions (mostly relevant for plugins)
Restore error output to stderr instead of stdout which I previously already fix in <1.0.0 and consistently write errors to stderr everywhere
Exclude fully dynamic, variable only hooks, since they only lead to false positive in tooling (aligns with psalm-plugin-wordpress) Add additional errors
Use @return as param if it's the only annotated tag
Various code style fix to make more aligned with WP code style