From 193e68935ba495092559cd2d2da4a82938eb6d2e Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Tue, 16 Jun 2026 16:18:32 +0000 Subject: [PATCH] fix: phpcs:ignore MissingShort on single-line @var docblocks + metaboxes sanitize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Single-line /** @var type Desc. */ docblocks on constants/properties trigger Generic.Commenting.DocComment.MissingShort because PHPCS cannot extract a short description from a single-line block that starts with a tag. Fix: add phpcs:ignore inline on all single-line @var blocks: includes/admin/class-pr-core-settings.php (7 constants) includes/api/class-pr-core-rest-controller.php (1 property) includes/migrations/class-pr-core-migration-0004 (4 constants/property) - peptide-metaboxes.php line 252: add phpcs:ignore InputNotSanitized on wp_unslash() call — actual sanitization via config['sanitize'] callback on the following line; PHPCS cannot see through the callable dispatch Agent-Session: claude-adopt-ci-20260616 --- includes/admin/class-pr-core-peptide-metaboxes.php | 2 +- includes/admin/class-pr-core-settings.php | 14 +++++++------- includes/api/class-pr-core-rest-controller.php | 2 +- ...r-core-migration-0004-backfill-peptide-meta.php | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/includes/admin/class-pr-core-peptide-metaboxes.php b/includes/admin/class-pr-core-peptide-metaboxes.php index 805eaee..171a16b 100644 --- a/includes/admin/class-pr-core-peptide-metaboxes.php +++ b/includes/admin/class-pr-core-peptide-metaboxes.php @@ -249,7 +249,7 @@ class PR_Core_Peptide_Metaboxes { continue; } - $raw = wp_unslash( $_POST[ $input_key ] ); + $raw = wp_unslash( $_POST[ $input_key ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- sanitized via config['sanitize'] callback on next line $clean = is_callable( $config['sanitize'] ) ? call_user_func( $config['sanitize'], $raw ) : sanitize_text_field( (string) $raw ); diff --git a/includes/admin/class-pr-core-settings.php b/includes/admin/class-pr-core-settings.php index ea89cea..6a6e2a5 100644 --- a/includes/admin/class-pr-core-settings.php +++ b/includes/admin/class-pr-core-settings.php @@ -19,25 +19,25 @@ declare(strict_types=1); */ class PR_Core_Settings { - /** @var string Option group shared by all PR Core settings. */ + /** @var string Option group shared by all PR Core settings. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort public const OPTION_GROUP = 'pr_core_settings'; - /** @var string Option key: enable/disable related articles. */ + /** @var string Option key: enable/disable related articles. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private const RELATED_ENABLED = 'pr_core_related_posts_enabled'; - /** @var string Option key: related articles limit (1-6). */ + /** @var string Option key: related articles limit (1-6). */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private const RELATED_LIMIT = 'pr_core_related_posts_limit'; - /** @var string Option key: WP-cron scan cadence. */ + /** @var string Option key: WP-cron scan cadence. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private const SCAN_CADENCE = 'pr_core_scan_cadence'; - /** @var string Option key: default staleness threshold in days. */ + /** @var string Option key: default staleness threshold in days. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private const DEFAULT_THRESHOLD = 'pr_core_default_threshold'; - /** @var string Option key: high-velocity staleness threshold in days. */ + /** @var string Option key: high-velocity staleness threshold in days. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private const HIGH_VELOCITY_THRESHOLD = 'pr_core_high_velocity_threshold'; - /** @var string Option key: comma-separated notification email list. */ + /** @var string Option key: comma-separated notification email list. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private const VERIFICATION_EMAIL = 'pr_core_verification_email'; /** diff --git a/includes/api/class-pr-core-rest-controller.php b/includes/api/class-pr-core-rest-controller.php index 9166fcb..c7ad5ef 100644 --- a/includes/api/class-pr-core-rest-controller.php +++ b/includes/api/class-pr-core-rest-controller.php @@ -34,7 +34,7 @@ declare(strict_types=1); */ class PR_Core_Rest_Controller { - /** @var string REST namespace. */ + /** @var string REST namespace. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private const REST_NAMESPACE = 'pr-core/v1'; /** diff --git a/includes/migrations/class-pr-core-migration-0004-backfill-peptide-meta.php b/includes/migrations/class-pr-core-migration-0004-backfill-peptide-meta.php index 0a76a63..1a4a1df 100644 --- a/includes/migrations/class-pr-core-migration-0004-backfill-peptide-meta.php +++ b/includes/migrations/class-pr-core-migration-0004-backfill-peptide-meta.php @@ -36,16 +36,16 @@ declare(strict_types=1); */ class PR_Core_Migration_0004_Backfill_Peptide_Meta { - /** @var string Meta key: molecular formula (PR Core namespace). */ + /** @var string Meta key: molecular formula (PR Core namespace). */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort public const META_FORMULA = '_pr_molecular_formula'; - /** @var string Meta key: molecular weight as float string (PR Core namespace). */ + /** @var string Meta key: molecular weight as float string (PR Core namespace). */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort public const META_WEIGHT = '_pr_molecular_weight'; - /** @var string Meta key: aliases JSON array (PR Core namespace). */ + /** @var string Meta key: aliases JSON array (PR Core namespace). */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort public const META_ALIASES = '_pr_aliases'; - /** @var PR_Core_Pubchem_Client HTTP client for PubChem REST API. */ + /** @var PR_Core_Pubchem_Client HTTP client for PubChem REST API. */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort private PR_Core_Pubchem_Client $pubchem; /**