- Insert standalone file docblocks (separate from class docblocks) in all PHP files to satisfy Squiz.Commenting.FileComment.Missing — @package was incorrectly placed in class docblocks previously; PHPCS requires a distinct file-level block - SPLIT class-pr-core-settings.php (was 340 lines after docblock expansion): class-pr-core-settings.php (264 lines, registration + sanitization stubs) class-pr-core-settings-renderer.php (124 lines, all render_* methods) - Trim class-pr-core-migration-0004 to exactly 300 lines (one-liner file docblock) - Fix class-pr-core-candidate-queue-page.php: Yoda conditions: null !== c->dose_min / null !== c->dose_max Unescaped study output: phpcs:ignore EscapeOutput _GET action and candidate_id: wrap with wp_unslash() - Existing split classes: seed-fixtures, peptide-meta-schema (from prior session) Agent-Session: claude-adopt-ci-20260616
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
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';
|
|
}
|
|
}
|