PHPCS: use disable/enable blocks for multi-line SQL interpolation
phpcs:ignore only suppresses the immediately following line; the SQL queries span multiple lines so the InterpolatedNotPrepared violation fires on the string continuation lines. Replaced with phpcs:disable/ enable pairs that wrap the full get_results/get_var call. Applies to all three DB queries in class-prv-ai-visibility-collector.php. Agent-Session: pr-vision rename v0.1.1
This commit is contained in:
@@ -91,7 +91,7 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Standings: latest result per peptide ────────────────────────
|
// ── Standings: latest result per peptide ────────────────────────
|
||||||
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||||
$standing_rows = $wpdb->get_results(
|
$standing_rows = $wpdb->get_results(
|
||||||
"SELECT peptide_slug, peptide_label,
|
"SELECT peptide_slug, peptide_label,
|
||||||
MAX(cited) AS cited,
|
MAX(cited) AS cited,
|
||||||
@@ -102,7 +102,7 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector {
|
|||||||
WHERE run_id = (SELECT run_id FROM {$table} ORDER BY captured_at DESC LIMIT 1)
|
WHERE run_id = (SELECT run_id FROM {$table} ORDER BY captured_at DESC LIMIT 1)
|
||||||
GROUP BY peptide_slug, peptide_label",
|
GROUP BY peptide_slug, peptide_label",
|
||||||
ARRAY_A
|
ARRAY_A
|
||||||
);
|
); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||||
|
|
||||||
$standings = array();
|
$standings = array();
|
||||||
foreach ( (array) $standing_rows as $row ) {
|
foreach ( (array) $standing_rows as $row ) {
|
||||||
@@ -117,10 +117,8 @@ class PRV_Ai_Visibility_Collector implements PRV_Data_Collector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Run metadata ────────────────────────────────────────────────
|
// ── Run metadata ────────────────────────────────────────────────
|
||||||
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||||
$last_run = $wpdb->get_var(
|
$last_run = $wpdb->get_var( "SELECT MAX(captured_at) FROM {$table}" ); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||||
"SELECT MAX(captured_at) FROM {$table}"
|
|
||||||
);
|
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'trendline' => $trendline,
|
'trendline' => $trendline,
|
||||||
|
|||||||
Reference in New Issue
Block a user