PHPCS: fix remaining violations (EscapeOutput, InterpolatedNotPrepared, missing @param)

- Collapse multi-line RuntimeException throws to single line so
  phpcs:ignore EscapeOutput.ExceptionNotEscaped applies correctly
  (gateway-client, perplexity-provider, openrouter-provider)
- Move phpcs:ignore InterpolatedNotPrepared from SQL string line to
  the get_results/get_var line where the violation fires (collector)
- Add descriptions to @param trendline and @param standings in panel
- Remove duplicate phpcs:ignore comment in collector

Agent-Session: pr-vision rename v0.1.1
This commit is contained in:
peptiderepo
2026-06-13 09:48:53 +00:00
parent 7d254019c6
commit f344b73c16
5 changed files with 13 additions and 23 deletions

View File

@@ -64,9 +64,8 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector {
$table = PRV_Table_Manager::get_table_name();
// ── Trendline: one score per run_id ────────────────────────────
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$run_rows = $wpdb->get_results(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
"SELECT run_id, MIN(captured_at) AS captured_at,
SUM(cited) AS cited_count,
COUNT(*) AS total_count,
@@ -92,9 +91,8 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector {
}
// ── Standings: latest result per peptide ────────────────────────
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$standing_rows = $wpdb->get_results(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
"SELECT peptide_slug, peptide_label,
MAX(cited) AS cited,
MIN(CASE WHEN cited=1 THEN our_position ELSE NULL END) AS our_position,
@@ -119,9 +117,8 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector {
}
// ── Run metadata ────────────────────────────────────────────────
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$last_run = $wpdb->get_var(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
"SELECT MAX(captured_at) FROM {$table}"
);