- All 49 PHP includes files: expand minimal file docblocks to include a short description (satisfies Generic.Commenting.DocComment.MissingShort) Format: <?php\n/**\n * Filename-derived description.\n *\n * @package ...\n */ - settings.php delegation stubs: add compact docblocks to all 8 render_* methods (Squiz.Commenting.FunctionComment.Missing, lines 93-231) - settings.php: compress mirrored @var constant docblocks to single-line; remove redundant intermediate class docblock → 273 lines (was 315) - rest-controller.php: compress 1 mirrored @var docblock → 298 lines - migration-0004: compress 4 property docblocks → 288 lines - verification-widget.php line 111: cast days_since to int + phpcs:ignore - verification-metabox.php line 80: phpcs:ignore on hardcoded badge_class - peptide-metaboxes.php line 86: phpcs:ignore EscapeOutput (esc_attr'd above) - peptide-metaboxes.php lines 147/148: Yoda null !== dose_min/dose_max - peptide-metaboxes.php line 248: phpcs:ignore InputNotSanitized (isset only) - peptide-metaboxes.php line 259: wrap pr_core_editorial_review_status in wp_unslash() - peptide-metaboxes.php line 262: Yoda 'published' !== old_status Agent-Session: claude-adopt-ci-20260616
47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Verification Sanitizers.
|
|
*
|
|
* @package Peptide_Repo_Core
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Standalone sanitization functions for verification_velocity and verification_status fields
|
|
*
|
|
* @package Peptide_Repo_Core
|
|
*/
|
|
|
|
/**
|
|
* Sanitizers for verification meta fields.
|
|
*
|
|
* What: Standalone sanitization functions for verification_velocity and verification_status fields.
|
|
* Who calls it: PR_Core_Peptide_CPT::get_meta_fields() sanitize callbacks.
|
|
* Dependencies: None.
|
|
*
|
|
* @see cpt/class-pr-core-peptide-cpt.php — Calls these from meta field registration.
|
|
*/
|
|
class PR_Core_Verification_Sanitizers {
|
|
|
|
/**
|
|
* Sanitize verification_velocity to allowed enum values.
|
|
*
|
|
* @param string $value Raw input.
|
|
* @return string Valid enum value (low, medium, high).
|
|
*/
|
|
public static function sanitize_velocity( string $value ): string {
|
|
return in_array( $value, array( 'low', 'medium', 'high' ), true ) ? $value : 'medium';
|
|
}
|
|
|
|
/**
|
|
* Sanitize verification_status to allowed enum values.
|
|
*
|
|
* @param string $value Raw input.
|
|
* @return string Valid enum value (current, due, overdue).
|
|
*/
|
|
public static function sanitize_status( string $value ): string {
|
|
return in_array( $value, array( 'current', 'due', 'overdue' ), true ) ? $value : 'current';
|
|
}
|
|
}
|