Fix CI: PHP 8.1 compat + WPCS violations in v0.3.0 new files

PHP 8.1: Cannot use positional argument after argument unpacking —
  class-prv-call-log-query.php line 77 (LIMIT/OFFSET args merged into
  array before spread).

WPCS fixes across 8 files:
- class-prv-admin-page-css.php: short description capital letter
- class-prv-admin-page.php: docblock started on same line as closing brace
- class-prv-call-drawer-renderer.php: param spacing, empty elseif blocks,
  extra indent on render_inline_script
- class-prv-call-log-query.php: InterpolatedNotPrepared (use
  phpcs:disable/enable block for WHERE-clause interpolation)
- class-prv-cost-rollup-query.php: InterpolatedNotPrepared for GROUP BY
  with dynamic column (phpcs:disable/enable block)
- class-prv-costs-renderer.php: AssociativeArrayFound on inline sub-arrays
- class-prv-probe-run-executor.php: docblock spacing, empty catch blocks,
  inline array items, ArrayItemNoNewLine (phpcs:disable on write_meta calls)
- class-prv-probe-runner.php: extra space before ?? operator
This commit is contained in:
peptiderepo
2026-06-15 09:23:21 +00:00
parent 4eee9f5f64
commit c489ed3424
8 changed files with 115 additions and 98 deletions

View File

@@ -148,10 +148,9 @@ class PRV_Cost_Rollup_Query {
$group_col = 'run_id';
}
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
// phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$rows = $wpdb->get_results(
$wpdb->prepare(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
"SELECT {$group_col} AS group_key,
COUNT(*) AS calls,
COALESCE(SUM(cost_usd),0) AS total_cost,
@@ -169,6 +168,7 @@ class PRV_Cost_Rollup_Query {
),
ARRAY_A
);
// phpcs:enable
$result = array();
foreach ( (array) $rows as $row ) {