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/wpRegisterAbility.php

    r61364 r61424  
    155155
    156156        // Store the original action count.
    157         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     157        $original_count = $wp_actions['init'] ?? 0;
    158158
    159159        // Reset the action count to simulate it not being fired.
     
    451451
    452452        // Store the original action count.
    453         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     453        $original_count = $wp_actions['init'] ?? 0;
    454454
    455455        // Reset the action count to simulate it not being fired.
     
    497497
    498498        // Store the original action count.
    499         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     499        $original_count = $wp_actions['init'] ?? 0;
    500500
    501501        // Reset the action count to simulate it not being fired.
     
    560560
    561561        // Store the original action count.
    562         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     562        $original_count = $wp_actions['init'] ?? 0;
    563563
    564564        // Reset the action count to simulate it not being fired.
     
    616616
    617617        // Store the original action count.
    618         $original_count = isset( $wp_actions['init'] ) ? $wp_actions['init'] : 0;
     618        $original_count = $wp_actions['init'] ?? 0;
    619619
    620620        // Reset the action count to simulate it not being fired.
Note: See TracChangeset for help on using the changeset viewer.