fix: phpcs:ignore MissingShort on single-line @var docblocks + metaboxes sanitize
- 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
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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';
|
||||
|
||||
/**
|
||||
|
||||
@@ -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';
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user