Repository navigation
Conversation
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.
Context
Psalm never ran on the plugin itself in CI (#50). Run locally, it reported 122 issues: 37 in the WordPress and WP-CLI stubs from
vendor, 7 intest.php(which demonstrates the plugin's own issues on purpose), and 78 inPlugin.php.Stacked on #71: merge that first; this pull request then targets
master.Solution
--output-format=github --shepherd), on the latest stable Psalm so a change on Psalm's master can't turn it red.InvalidDocblockis suppressed forvendor: those are docblocks of the bundled stubs, not of this plugin.final(ClassMustBeFinal) and overriding methods have#[\Override](MissingOverrideAttribute). The attribute is ignored on PHP below 8.3.psalm-baseline.xml, so new code is checked and they can be fixed one by one. Most areRiskyTruthyFalsyComparison,UndefinedPropertyFetchon argument placeholders and uses of Psalm's internal classes; some may be real bugs, such asgetDynamicHookName()returning anintdespite its?stringreturn type.findUnusedPsalmSuppressis on, as in the PHPUnit plugin.Fixes #50