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/data/WPHTTP-testcase-redirection-script.php

    r55210 r61424  
    5555if ( isset( $_GET['post-redirect-to-method'] ) ) {
    5656    $method = $_SERVER['REQUEST_METHOD'];
    57     $response_code = isset( $_GET['response_code'] ) ? $_GET['response_code'] : 301;
     57    $response_code = $_GET['response_code'] ?? 301;
    5858
    5959    if ( 'POST' == $method && ! isset( $_GET['redirection-performed'] ) ) {
     
    124124
    125125
    126 $rt = isset($_GET['rt']) ? $_GET['rt'] : 5;
    127 $r = isset($_GET['r']) ? $_GET['r'] : 0;
     126$rt = $_GET['rt'] ?? 5;
     127$r = $_GET['r'] ?? 0;
    128128
    129129if ( $r < $rt ) {
Note: See TracChangeset for help on using the changeset viewer.