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/general/wpResourceHints.php

    r56548 r61424  
    1313    public function set_up() {
    1414        parent::set_up();
    15         $this->old_wp_scripts = isset( $GLOBALS['wp_scripts'] ) ? $GLOBALS['wp_scripts'] : null;
    16         $this->old_wp_styles  = isset( $GLOBALS['wp_styles'] ) ? $GLOBALS['wp_styles'] : null;
     15        $this->old_wp_scripts = $GLOBALS['wp_scripts'] ?? null;
     16        $this->old_wp_styles  = $GLOBALS['wp_styles'] ?? null;
    1717
    1818        remove_action( 'wp_default_scripts', 'wp_default_scripts' );
Note: See TracChangeset for help on using the changeset viewer.