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

@@ -120,10 +120,22 @@ class PRV_Costs_Renderer {
*/
public function render_subnav( string $active ): void {
$tabs = array(
'dashboard' => array( 'label' => __( 'Dashboard', 'pr-vision' ), 'slug' => 'pr-vision' ),
'costs' => array( 'label' => __( 'Costs', 'pr-vision' ), 'slug' => 'pr-vision-costs' ),
'calls' => array( 'label' => __( 'Call Log', 'pr-vision' ), 'slug' => 'pr-vision-calls' ),
'settings' => array( 'label' => __( 'Settings', 'pr-vision' ), 'slug' => 'pr-vision-settings' ),
'dashboard' => array(
'label' => __( 'Dashboard', 'pr-vision' ),
'slug' => 'pr-vision',
),
'costs' => array(
'label' => __( 'Costs', 'pr-vision' ),
'slug' => 'pr-vision-costs',
),
'calls' => array(
'label' => __( 'Call Log', 'pr-vision' ),
'slug' => 'pr-vision-calls',
),
'settings' => array(
'label' => __( 'Settings', 'pr-vision' ),
'slug' => 'pr-vision-settings',
),
);
echo '<nav class="prv-subnav" aria-label="' . esc_attr__( 'PR Vision navigation', 'pr-vision' ) . '">';
foreach ( $tabs as $key => $tab ) {
@@ -223,7 +235,13 @@ class PRV_Costs_Renderer {
foreach ( $levels as $lvl ) {
$is_active = ( $lvl === $level );
$cls = 'prv-seg-btn' . ( $is_active ? ' prv-seg-btn--active' : '' );
$url = add_query_arg( array( 'prv_level' => $lvl, 'prv_offset' => 0 ), $base_url );
$url = add_query_arg(
array(
'prv_level' => $lvl,
'prv_offset' => 0,
),
$base_url
);
echo '<a href="' . esc_url( $url ) . '" class="' . esc_attr( $cls ) . '"' . ( $is_active ? ' aria-current="true"' : '' ) . '>';
echo esc_html( ucfirst( $lvl ) );
echo '</a>';