Adopt silverassist/coding-standards for PHPCS - #30
Merged
miguelcolmenares merged 2 commits intoAug 12, 2026
Conversation
This is a library, not a WordPress plugin (no main plugin file, no plugins_loaded hook, no WordPress dependency in composer.json's require), so PSR-12 (silverassist/coding-standards) applies rather than WordPress-Extra (silverassist/wp-coding-standards) -- confirmed by this repo's own pre-existing ruleset, which already deliberately based itself on PSR12 plus a hand-picked handful of WordPress security/i18n sniffs, not full WordPress-Extra. Adopting the shared SilverAssist ruleset (PSR-12 + mandatory PHPDoc) surfaced 181 violations: - 103 auto-fixed (phpcbf): spacing, boolean->bool, etc. - 72 comments/param descriptions missing terminal punctuation. - 66 missing @return tags -- inferred each one's actual return type from its function signature and inserted the correct tag, not a blanket @return mixed. - 8 missing docblocks entirely (test methods). - 5 untyped params that already had "@PARAM mixed" in their docblock but no matching `mixed` PHP type declaration -- added the real type hint. phpstan.neon deliberately left untouched: this repo has zero CI quality gate today (only Dependabot + CodeQL run), and its committed config already has 29 pre-existing PHPStan errors unrelated to this change (accumulated dependency drift, not something this PR should silently absorb into an unrelated migration). Verified with the real WordPress Test Suite, not just phpcs/phpstan: 58/58 tests passing.
Contributor
There was a problem hiding this comment.
Pull request overview
Adopts the shared SilverAssist PHPCS ruleset and aligns source and test documentation with its requirements.
Changes:
- Adds the shared coding-standard dependencies and PHP 8.2 platform configuration.
- Replaces the base PSR-12 ruleset with
SilverAssist. - Adds PHPDoc return tags, punctuation, and explicit
mixedparameter types.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
composer.json |
Adds PHPCS dependencies and platform configuration. |
phpcs.xml |
Adopts the SilverAssist ruleset. |
src/Updater.php |
Aligns types and PHPDoc with the ruleset. |
src/UpdaterConfig.php |
Corrects PHPDoc punctuation. |
tests/bootstrap.php |
Adds callback return documentation. |
tests/wordpress-mocks.php |
Aligns mock types and PHPDoc. |
tests/fixtures/mock-plugin/mock-plugin.php |
Adds return documentation. |
tests/Integration/DownloadFilterTest.php |
Adds test return tags. |
tests/Integration/UpdaterIntegrationTest.php |
Adds test return tags. |
tests/Unit/UpdaterConfigTest.php |
Adds missing test documentation. |
tests/Unit/UpdaterEnqueueScriptTest.php |
Adds and updates test documentation. |
tests/WordPress/MockPluginTest.php |
Adds test return tags. |
tests/WordPress/WordPressHooksTest.php |
Adds test return tags. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Addresses Copilot review feedback -- the function never returns a value, so documenting it as mixed was inaccurate and contradicted the PR's own goal of inferring return tags from actual behavior, not a blanket fallback.
miguelcolmenares
deleted the
feature/adopt-silverassist-coding-standards
branch
August 12, 2026 18:40
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.
Summary
SilverAssistPSR-12 ruleset (silverassist/coding-standards) — this is a library, not a WordPress plugin (no main plugin file, noplugins_loadedhook, no WordPress dependency inrequire), confirmed by this repo's own pre-existing ruleset already being PSR-12-based with a handful of hand-picked WordPress security/i18n sniffs on top, not fullWordPress-Extra.@returntags (each inferred from the actual function signature, not blanketmixed), 8 missing docblocks, 5 params needing a realmixedtype hint to match their existing docblock.phpstan.neondeliberately left untouched — this repo has no CI quality gate today (only Dependabot + CodeQL), and its committed config has 29 pre-existing PHPStan errors from accumulated dependency drift, unrelated to this change.Test plan
vendor/bin/phpcs— clean