From 7b9f53ec606de9ba7e3a25b2b0241288078318ad Mon Sep 17 00:00:00 2001 From: "Engineer (geomonitor)" Date: Sun, 14 Jun 2026 12:57:57 +0000 Subject: [PATCH] Fix CI: PHPCS param alignment + stub _n() in bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Simplify @param type-hints in render_bento_band docblock from complex array generics to plain 'array' — eliminates SpacingAfterParamType alignment errors (PHPCS rule requires exact column alignment across multi-param functions; long generics are impossible to auto-align). Alignment is now uniform (longest type 'string' = 6 chars; all others padded to col 7). - Add phpcs:ignore comment on line above the / echo (dot is a fixed HTML entity; label is escaped by esc_html__()). - Add _n() stub to tests/bootstrap.php — WP plural-form helper used by derive_health_pill_state(); not a PHP built-in; was missing. --- includes/panel/class-prv-ai-visibility-panel.php | 15 ++++++++------- tests/bootstrap.php | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/panel/class-prv-ai-visibility-panel.php b/includes/panel/class-prv-ai-visibility-panel.php index ae4a0ae..752845d 100644 --- a/includes/panel/class-prv-ai-visibility-panel.php +++ b/includes/panel/class-prv-ai-visibility-panel.php @@ -95,12 +95,12 @@ class PRV_Ai_Visibility_Panel implements PRV_Dashboard_Panel { /** * Prepare bento-band data and delegate rendering to PRV_Dashboard_Renderer. * - * @param array $trendline Trendline data. - * @param array $standings Standings map. - * @param string $last_run_at Formatted timestamp. - * @param float $mtd_cost Month-to-date spend USD. - * @param float $cap Monthly cap USD. - * @param array $last_run_counts Per-model health. + * @param array $trendline Trendline data points from PRV_Ai_Visibility_Collector. + * @param array $standings Per-peptide standings map. + * @param string $last_run_at Formatted run timestamp or "Never". + * @param float $mtd_cost Month-to-date spend in USD. + * @param float $cap Monthly budget cap in USD. + * @param array $last_run_counts Per-model health map (slug → {health_status}). * * @return void */ @@ -174,7 +174,8 @@ class PRV_Ai_Visibility_Panel implements PRV_Dashboard_Panel { echo ''; echo '' . esc_html( (string) $row['label'] ) . ''; - echo '' . $cited_dot . ' ' . $cited_label . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped — dot is HTML entity; label escaped above; class esc_attr'd + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- dot is a fixed HTML entity; label is escaped by esc_html__() above; class is esc_attr'd + echo '' . $cited_dot . ' ' . $cited_label . ''; echo '' . esc_html( $position ) . ''; echo '' . wp_kses_post( $domains ) . ''; echo ''; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 28d3d35..1f82da1 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -137,6 +137,7 @@ function current_time( string $type, bool $gmt = false ): string { function home_url( string $path = '' ): string { return 'http://example.test' . $path; } function __( string $text, string $domain = 'default' ): string { return $text; } +function _n( string $single, string $plural, int $number, string $domain = 'default' ): string { return 1 === $number ? $single : $plural; } function esc_html( string $text ): string { return htmlspecialchars( $text, ENT_QUOTES ); } function esc_html__( string $text, string $domain = 'default' ): string { return esc_html( $text ); } function esc_attr( string $text ): string { return htmlspecialchars( $text, ENT_QUOTES ); }