Skip to content

Adopt SilverAssistWP coding standard + shared PHPStan configs - #3

Merged
miguelcolmenares merged 5 commits into
mainfrom
feature/adopt-silverassist-coding-standards
Aug 17, 2026
Merged

Adopt SilverAssistWP coding standard + shared PHPStan configs#3
miguelcolmenares merged 5 commits into
mainfrom
feature/adopt-silverassist-coding-standards

Conversation

@miguelcolmenares

Copy link
Copy Markdown
Member

Summary

  • Adopts the SilverAssistWP PHPCS ruleset (in place of hand-rolled WordPress-Extra/WordPress-Docs blocks) in all three sub-plugins — community-listings, contentful-tables, graphql-shortcode-support
  • Composes the shared phpstan/base.neon from silverassist/coding-standards and silverassist/wp-coding-standards in each sub-plugin's phpstan.neon, replacing the locally-duplicated level:8 + excludePaths baseline
  • Fixes the mechanical @param spacing violations the stricter ruleset surfaced (via phpcbf) in contentful-tables (9) and community-listings (24)
  • Pins platform.php to 8.2.0 in each sub-plugin's composer.json to match the declared PHP floor

Part of the portfolio-wide coding-standards rollout already merged in contact-form-to-api, paubox-cf7, nextjs-graphql-hooks, leadcapture-form, leadgen-app-form, acf-clone-fields, silver-assist-post-revalidate, and silver-assist-security.

Verified

  • vendor/bin/phpstan analyse in each sub-plugin: identical results before/after this change (contentful-tables and graphql-shortcode-support: 0 errors; community-listings: same pre-existing 3 errors, unrelated to this PR, reproduced on the prior config too)
  • graphql-shortcode-support's phpcs.xml collapse verified byte-identical PHPCS output before/after

Deliberately out of scope

.github/workflows/ci.yml and scripts/ are untouched — this monorepo's Makefile-driven, multi-plugin CI has no equivalent to the per-repo reusable quality-checks.yml workflow used elsewhere in the portfolio, matching the same precedent already set for acf-clone-fields and silver-assist-security (both of which also kept their existing CI as-is).

Test plan

  • CI passes on this PR
  • composer install succeeds in all 3 sub-plugins with the new dev dependencies
  • Spot-check community-listings' pre-existing 3 PHPStan errors are unchanged from main, not newly introduced

- Add silverassist/coding-standards and silverassist/wp-coding-standards to require-dev
- Pin platform.php to 8.2.0 to match the declared floor
- Swap phpcs.xml's WordPress-Extra block for SilverAssistWP (already excludes
  the PSR-4 filename rules this plugin was locally excluding)
- Fix 24 mechanical @PARAM spacing violations surfaced by the stricter ruleset via phpcbf
- Add silverassist/coding-standards and silverassist/wp-coding-standards to require-dev
- Pin platform.php to 8.2.0 to match the declared floor
- Swap phpcs.xml's WordPress-Extra block for SilverAssistWP (already excludes
  the PSR-4 filename rules this plugin was locally excluding)
- Fix 9 mechanical @PARAM spacing violations surfaced by the stricter ruleset via phpcbf
- Add silverassist/coding-standards and silverassist/wp-coding-standards to require-dev
- Pin platform.php to 8.2.0 to match the declared floor
- Collapse phpcs.xml's manually-declared WordPress-Extra/WordPress-Docs/allowances
  block down to SilverAssistWP, which already covers all of it (verified
  byte-identical phpcs output before/after)
Each sub-plugin already required silverassist/coding-standards and
silverassist/wp-coding-standards as dev dependencies but only consumed
szepeviktor/phpstan-wordpress from them directly, duplicating the
shared level:8 + excludePaths baseline locally instead of composing it.

Switches all three phpstan.neon files to include the shared base.neon
from both packages, per the pattern established across the rest of the
portfolio (nextjs-graphql-hooks, silver-assist-security). Verified with
vendor/bin/phpstan analyse in each sub-plugin — identical results to
before (contentful-tables and graphql-shortcode-support: 0 errors;
community-listings: pre-existing 3 errors, unrelated to this change,
reproduced on the prior config too).

CI (.github/workflows/ci.yml) and scripts/ are left untouched — this
monorepo's Makefile-driven, multi-plugin CI has no equivalent to the
per-repo reusable quality-checks.yml workflow used elsewhere, matching
the precedent set for acf-clone-fields and silver-assist-security.
No push: this repo is blocked on GitHub write access.
WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
flagged $source->databaseId as needing snake_case — but databaseId is
WPGraphQL's own property name on its Post model, not one we declare;
renaming it would break the property access. Newly surfaced by the
SilverAssistWP ruleset adopted in this branch (the prior phpcs.xml
didn't enforce this sniff here).

Verified: PHPCS clean in all 3 sub-plugins, PHPStan unchanged
(community-listings' pre-existing 3 errors, contentful-tables and
graphql-shortcode-support both 0).
@miguelcolmenares
miguelcolmenares merged commit 8ac2dfc into main Aug 17, 2026
3 checks passed
@miguelcolmenares
miguelcolmenares deleted the feature/adopt-silverassist-coding-standards branch August 17, 2026 07:18
miguelcolmenares added a commit that referenced this pull request Aug 17, 2026
…ors (#4)

Fix silently-swallowed CI failures + resolve pre-existing PHPStan errors (#4)

- Resolved all 3 pre-existing PHPStan errors in community-listings via real refactors, no suppressions
- Fixed Makefile phpcs/phpstan/install/install-dev/build targets to propagate failures across all sub-plugins instead of only the last one in the loop
- Aligned make phpcs with CI's own --warning-severity=0 behavior
- Backfilled CHANGELOG entries for #2 and #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant