From f72593c49f181df7de4d4ade4fc32309e1e52b63 Mon Sep 17 00:00:00 2001 From: Miguel Colmenares Date: Wed, 12 Aug 2026 13:57:02 -0500 Subject: [PATCH 1/5] feat: Adopt SilverAssistWP coding standard in community-listings - 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 --- community-listings/composer.json | 7 +++- .../includes/Service/CptRegistrar.php | 32 +++++++++---------- .../includes/Service/GraphQLResolver.php | 16 +++++----- community-listings/phpcs.xml | 5 +-- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/community-listings/composer.json b/community-listings/composer.json index 8fc6005..582d824 100644 --- a/community-listings/composer.json +++ b/community-listings/composer.json @@ -10,6 +10,8 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "phpstan/phpstan": "^2.1", + "silverassist/coding-standards": "^1.0", + "silverassist/wp-coding-standards": "^1.0", "szepeviktor/phpstan-wordpress": "^2.0", "wp-coding-standards/wpcs": "^3.1" }, @@ -22,7 +24,10 @@ "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true }, - "sort-packages": true + "sort-packages": true, + "platform": { + "php": "8.2.0" + } }, "scripts": { "phpcs": "phpcs", diff --git a/community-listings/includes/Service/CptRegistrar.php b/community-listings/includes/Service/CptRegistrar.php index 30e8743..144b4ff 100644 --- a/community-listings/includes/Service/CptRegistrar.php +++ b/community-listings/includes/Service/CptRegistrar.php @@ -96,28 +96,28 @@ public static function register_post_type(): void { ); $args = array( - 'labels' => $labels, - 'public' => true, - 'publicly_queryable' => true, - 'show_ui' => true, - 'show_in_menu' => true, - 'show_in_rest' => true, - 'rest_base' => 'community', - 'query_var' => true, - 'rewrite' => array( + 'labels' => $labels, + 'public' => true, + 'publicly_queryable' => true, + 'show_ui' => true, + 'show_in_menu' => true, + 'show_in_rest' => true, + 'rest_base' => 'community', + 'query_var' => true, + 'rewrite' => array( 'slug' => 'communities', 'with_front' => false, ), - 'capability_type' => 'post', - 'map_meta_cap' => true, - 'has_archive' => true, - 'hierarchical' => true, - 'menu_position' => 5, - 'menu_icon' => 'dashicons-location-alt', + 'capability_type' => 'post', + 'map_meta_cap' => true, + 'has_archive' => true, + 'hierarchical' => true, + 'menu_position' => 5, + 'menu_icon' => 'dashicons-location-alt', 'show_in_graphql' => true, 'graphql_single_name' => 'community', 'graphql_plural_name' => 'communities', - 'supports' => array( + 'supports' => array( 'title', 'editor', 'excerpt', diff --git a/community-listings/includes/Service/GraphQLResolver.php b/community-listings/includes/Service/GraphQLResolver.php index 99ab1a9..d37c18b 100644 --- a/community-listings/includes/Service/GraphQLResolver.php +++ b/community-listings/includes/Service/GraphQLResolver.php @@ -51,15 +51,15 @@ public function register(): void { * * @since 2.0.0 * - * @param mixed $result The resolved field value. - * @param mixed $source The source object. + * @param mixed $result The resolved field value. + * @param mixed $source The source object. * @param array $args The field arguments. - * @param mixed $context The AppContext. - * @param mixed $info The ResolveInfo. - * @param string $type_name The GraphQL type name. - * @param string $field_key The field key. - * @param mixed $field_def The field definition. - * @param mixed $field_resolver The field resolver. + * @param mixed $context The AppContext. + * @param mixed $info The ResolveInfo. + * @param string $type_name The GraphQL type name. + * @param string $field_key The field key. + * @param mixed $field_def The field definition. + * @param mixed $field_resolver The field resolver. * @return mixed The result with shortcodes rendered. */ public function resolve_shortcodes( diff --git a/community-listings/phpcs.xml b/community-listings/phpcs.xml index 779ddfe..b7fc8d2 100644 --- a/community-listings/phpcs.xml +++ b/community-listings/phpcs.xml @@ -13,10 +13,7 @@ - - - - + From 97bfc29abec888e74cbf21e2d25e2b55e5c4e3fe Mon Sep 17 00:00:00 2001 From: Miguel Colmenares Date: Wed, 12 Aug 2026 13:57:55 -0500 Subject: [PATCH 2/5] feat: Adopt SilverAssistWP coding standard in contentful-tables - 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 --- contentful-tables/composer.json | 7 ++++++- .../includes/Service/GraphQLResolver.php | 16 ++++++++-------- .../includes/View/ChartRenderer.php | 2 +- contentful-tables/phpcs.xml | 5 +---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/contentful-tables/composer.json b/contentful-tables/composer.json index c86492e..36ff023 100644 --- a/contentful-tables/composer.json +++ b/contentful-tables/composer.json @@ -10,6 +10,8 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "phpstan/phpstan": "^2.1", + "silverassist/coding-standards": "^1.0", + "silverassist/wp-coding-standards": "^1.0", "szepeviktor/phpstan-wordpress": "^2.0", "wp-coding-standards/wpcs": "^3.1" }, @@ -22,7 +24,10 @@ "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true }, - "sort-packages": true + "sort-packages": true, + "platform": { + "php": "8.2.0" + } }, "scripts": { "phpcs": "phpcs", diff --git a/contentful-tables/includes/Service/GraphQLResolver.php b/contentful-tables/includes/Service/GraphQLResolver.php index e778613..0c3619f 100644 --- a/contentful-tables/includes/Service/GraphQLResolver.php +++ b/contentful-tables/includes/Service/GraphQLResolver.php @@ -69,15 +69,15 @@ public function register(): void { * * @since 4.0.0 * - * @param mixed $result The resolved field value. - * @param mixed $source The source object. + * @param mixed $result The resolved field value. + * @param mixed $source The source object. * @param array $args The field arguments. - * @param mixed $context The AppContext. - * @param mixed $info The ResolveInfo. - * @param string $type_name The GraphQL type name. - * @param string $field_key The field key. - * @param mixed $field_def The field definition. - * @param mixed $field_resolver The field resolver. + * @param mixed $context The AppContext. + * @param mixed $info The ResolveInfo. + * @param string $type_name The GraphQL type name. + * @param string $field_key The field key. + * @param mixed $field_def The field definition. + * @param mixed $field_resolver The field resolver. * @return mixed The result with shortcodes rendered. */ public function resolve_shortcodes( diff --git a/contentful-tables/includes/View/ChartRenderer.php b/contentful-tables/includes/View/ChartRenderer.php index 8a8c88a..74d2be8 100644 --- a/contentful-tables/includes/View/ChartRenderer.php +++ b/contentful-tables/includes/View/ChartRenderer.php @@ -82,7 +82,7 @@ private static function render_source( array $chart_data ): string { * @since 4.0.0 * * @param array> $table_rows Table data rows. - * @param string $label_prefix Prefix for numeric values. + * @param string $label_prefix Prefix for numeric values. * @return string Rendered HTML. */ private static function render_table_source( array $table_rows, string $label_prefix ): string { diff --git a/contentful-tables/phpcs.xml b/contentful-tables/phpcs.xml index 039743c..928ed53 100644 --- a/contentful-tables/phpcs.xml +++ b/contentful-tables/phpcs.xml @@ -13,10 +13,7 @@ - - - - + From b48bdc89cfad9084a31536e937b6141f355f9877 Mon Sep 17 00:00:00 2001 From: Miguel Colmenares Date: Wed, 12 Aug 2026 13:59:18 -0500 Subject: [PATCH 3/5] feat: Adopt SilverAssistWP coding standard in graphql-shortcode-support - 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) --- graphql-shortcode-support/composer.json | 5 ++++ graphql-shortcode-support/phpcs.xml | 34 +++++-------------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/graphql-shortcode-support/composer.json b/graphql-shortcode-support/composer.json index a8e4470..8d13397 100644 --- a/graphql-shortcode-support/composer.json +++ b/graphql-shortcode-support/composer.json @@ -21,6 +21,8 @@ "phpcompatibility/phpcompatibility-wp": "^2.1", "phpstan/phpstan": "*", "phpunit/phpunit": "^9.6", + "silverassist/coding-standards": "^1.0", + "silverassist/wp-coding-standards": "^1.0", "squizlabs/php_codesniffer": "^3.7 || ^4.0", "szepeviktor/phpstan-wordpress": "^1.3 || ^2.0", "wp-coding-standards/wpcs": "^3.0", @@ -51,6 +53,9 @@ "allow-plugins": { "composer/installers": true, "dealerdirect/phpcodesniffer-composer-installer": true + }, + "platform": { + "php": "8.2.0" } } } diff --git a/graphql-shortcode-support/phpcs.xml b/graphql-shortcode-support/phpcs.xml index 748a073..7bc4d36 100644 --- a/graphql-shortcode-support/phpcs.xml +++ b/graphql-shortcode-support/phpcs.xml @@ -19,24 +19,12 @@ - - - - - - - - - - - - - - - - - - + + @@ -47,14 +35,4 @@ - - - - - - - - - - From ffbbc60f37ef1b422b0bfeb0fd16cfc2f3df9ba7 Mon Sep 17 00:00:00 2001 From: Miguel Colmenares Date: Thu, 13 Aug 2026 12:54:26 -0500 Subject: [PATCH 4/5] chore: Compose shared PHPStan base configs across sub-plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- community-listings/phpstan.neon | 3 ++- contentful-tables/phpstan.neon | 3 ++- graphql-shortcode-support/phpstan.neon | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/community-listings/phpstan.neon b/community-listings/phpstan.neon index 2dadd93..dcf4215 100644 --- a/community-listings/phpstan.neon +++ b/community-listings/phpstan.neon @@ -1,8 +1,9 @@ includes: + - vendor/silverassist/coding-standards/phpstan/base.neon + - vendor/silverassist/wp-coding-standards/phpstan/base.neon - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: - level: 8 paths: - includes - community-listings.php diff --git a/contentful-tables/phpstan.neon b/contentful-tables/phpstan.neon index 8784c4c..f4fb1ad 100644 --- a/contentful-tables/phpstan.neon +++ b/contentful-tables/phpstan.neon @@ -1,8 +1,9 @@ includes: + - vendor/silverassist/coding-standards/phpstan/base.neon + - vendor/silverassist/wp-coding-standards/phpstan/base.neon - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: - level: 8 paths: - includes - contentful-tables.php diff --git a/graphql-shortcode-support/phpstan.neon b/graphql-shortcode-support/phpstan.neon index 2721226..7a6e65c 100644 --- a/graphql-shortcode-support/phpstan.neon +++ b/graphql-shortcode-support/phpstan.neon @@ -1,8 +1,9 @@ includes: + - vendor/silverassist/coding-standards/phpstan/base.neon + - vendor/silverassist/wp-coding-standards/phpstan/base.neon - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: - level: 8 paths: - includes bootstrapFiles: From e8822d200530fa33c285762f41bc2159377f9543 Mon Sep 17 00:00:00 2001 From: Miguel Colmenares Date: Mon, 17 Aug 2026 02:08:27 -0500 Subject: [PATCH 5/5] fix(community-listings): suppress false-positive PHPCS naming violation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- community-listings/includes/Service/CptRegistrar.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/community-listings/includes/Service/CptRegistrar.php b/community-listings/includes/Service/CptRegistrar.php index 144b4ff..b5cdc8e 100644 --- a/community-listings/includes/Service/CptRegistrar.php +++ b/community-listings/includes/Service/CptRegistrar.php @@ -191,8 +191,12 @@ public function register_graphql_meta_fields(): void { 'resolve' => static function ( $source ) use ( $key, $type ) { $post_id = 0; - // WPGraphQL Model\Post — preferred. + // WPGraphQL Model\Post — preferred. `databaseId` is WPGraphQL's own + // property name on its Post model; it cannot be renamed to snake_case + // without breaking the property access. + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase if ( \is_object( $source ) && isset( $source->databaseId ) ) { + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase $post_id = (int) $source->databaseId; } elseif ( $source instanceof \WP_Post ) { $post_id = (int) $source->ID;