Make WordPress Core


Ignore:
Timestamp:
01/03/2026 06:15:57 AM (3 months ago)
Author:
westonruter
Message:

Code Modernization: Update tests to use null coalescing operator in place of isset() in ternaries.

Developed as a subset of https://github.com/WordPress/wordpress-develop/pull/10654

Follow-up to [61404], [61403].

See #58874, #63430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php

    r61130 r61424  
    8383
    8484        // Store the original action count.
    85         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     85        $original_count = $wp_actions['init'] ?? 0;
    8686
    8787        // Reset the action count to simulate it not being fired.
     
    133133
    134134        // Store the original action count.
    135         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     135        $original_count = $wp_actions['init'] ?? 0;
    136136
    137137        // Reset the action count to simulate it not being fired.
     
    195195
    196196        // Store the original action count.
    197         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     197        $original_count = $wp_actions['init'] ?? 0;
    198198
    199199        // Reset the action count to simulate it not being fired.
     
    256256
    257257        // Store the original action count.
    258         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     258        $original_count = $wp_actions['init'] ?? 0;
    259259
    260260        // Reset the action count to simulate it not being fired.
     
    329329
    330330        // Store the original action count.
    331         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     331        $original_count = $wp_actions['init'] ?? 0;
    332332
    333333        // Reset the action count to simulate it not being fired.
Note: See TracChangeset for help on using the changeset viewer.