Make WordPress Core

Changeset 58682

Timestamp:
07/06/2024 02:52:05 PM (4 weeks ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Remove obsolete comments about older PHP versions.

This commit:

  • Removes various comments referencing PHP versions which are no longer supported.
  • Removes various comments containing “hints” of things to do after a particular PHP version drop. These hints are incorrect/not actionable for various reasons, so have no value:
    • Even though a function could be turned into a closure, removing the function would be a backward compatibility break which is not acceptable, so this suggestion is not actionable.
    • Short ternaries are forbidden by the coding standard exactly to prevent the faulty code suggested in the comment from getting into the codebase.

Follow-up to [1243/tests], [6543], [11816], [29861], [29864], [34928], [35369], [36698], [38694], [50786], [58678].

Props jrf, ayeshrajans.
See #61574.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/meta-boxes.php

    r58284 r58682  
    12711271    }
    12721272
    1273     $link_rel  = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
     1273    $link_rel  = isset( $link->link_rel ) ? $link->link_rel : '';
    12741274    $link_rels = preg_split( '/\s+/', $link_rel );
    12751275
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r58376 r58682  
    61426142     * into a partial's render_callback so we cannot use get_custom_logo() as
    61436143     * the render_callback directly since it expects a blog ID as the first
    6144      * argument. When WP no longer supports PHP 5.3, this method can be removed
    6145      * in favor of an anonymous function.
     6144     * argument.
    61466145     *
    61476146     * @see WP_Customize_Manager::register_controls()
  • trunk/src/wp-includes/class-wp-object-cache.php

    r55549 r58682  
    7474
    7575    /**
    76      * Sets up object properties; PHP 5 style constructor.
     76     * Sets up object properties.
    7777     *
    7878     * @since 2.0.8
  • trunk/src/wp-includes/http.php

    r58388 r58682  
    700700 * across PHP versions.
    701701 *
    702  * PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute URLs, including
    703  * schemeless and relative URLs with "://" in the path. This function works around
    704  * those limitations providing a standard output on PHP 5.2~5.4+.
    705  *
    706  * Secondly, across various PHP versions, schemeless URLs containing a ":" in the query
    707  * are being handled inconsistently. This function works around those differences as well.
     702 * Across various PHP versions, schemeless URLs containing a ":" in the query
     703 * are being handled inconsistently. This function works around those differences.
    708704 *
    709705 * @since 4.4.0
  • trunk/src/wp-includes/load.php

    r58128 r58682  
    453453/**
    454454 * Gets the time elapsed so far during this PHP script.
    455  *
    456  * Uses REQUEST_TIME_FLOAT that appeared in PHP 5.4.0.
    457455 *
    458456 * @since 5.8.0
  • trunk/src/wp-includes/rest-api/class-wp-rest-request.php

    r56193 r58682  
    710710     *
    711711     * Parses out URL-encoded bodies for request methods that aren't supported
    712      * natively by PHP. In PHP 5.x, only POST has these parsed automatically.
     712     * natively by PHP.
    713713     *
    714714     * @since 4.4.0
  • trunk/tests/phpunit/tests/formatting/escTextarea.php

    r53562 r58682  
    1313
    1414    /*
    15      * Only fails in PHP 5.4 onwards
    1615     * @ticket 23688
    1716     */
  • trunk/tests/phpunit/tests/formatting/wpHtmleditPre.php

    r53562 r58682  
    1414
    1515    /*
    16      * Only fails in PHP 5.4 onwards
    1716     * @ticket 23688
    1817     */
  • trunk/tests/phpunit/tests/formatting/wpRicheditPre.php

    r53562 r58682  
    1414
    1515    /*
    16      * Only fails in PHP 5.4 onwards
    1716     * @ticket 23688
    1817     */
  • trunk/tests/phpunit/tests/http/http.php

    r57987 r58682  
    115115            ),
    116116
    117             // < PHP 5.4.7: Schemeless URL.
     117            // Schemeless URL.
    118118            array(
    119119                '//example.com/path/',
     
    139139            ),
    140140
    141             // < PHP 5.4.7: Scheme separator in the URL.
     141            // Scheme separator in the URL.
    142142            array(
    143143                'http://example.com/http://example.net/',
     
    150150            array( '/path/http://example.net/', array( 'path' => '/path/http://example.net/' ) ),
    151151
    152             // < PHP 5.4.7: IPv6 literals in schemeless URLs are handled incorrectly.
     152            // .
    153153            array(
    154154                '//[::FFFF::127.0.0.1]/',
     
    239239            array( self::FULL_TEST_URL, PHP_URL_FRAGMENT, 'anchor' ),
    240240
    241             // < PHP 5.4.7: Schemeless URL.
     241            // Schemeless URL.
    242242            array( '//example.com/path/', PHP_URL_HOST, 'example.com' ),
    243243            array( '//example.com/path/', PHP_URL_PATH, '/path/' ),
     
    247247            array( 'http://example.com//path/', PHP_URL_PATH, '//path/' ),
    248248
    249             // < PHP 5.4.7: Scheme separator in the URL.
     249            // Scheme separator in the URL.
    250250            array( 'http://example.com/http://example.net/', PHP_URL_HOST, 'example.com' ),
    251251            array( 'http://example.com/http://example.net/', PHP_URL_PATH, '/http://example.net/' ),
     
    253253            array( '/path/http://example.net/', PHP_URL_PATH, '/path/http://example.net/' ),
    254254
    255             // < PHP 5.4.7: IPv6 literals in schemeless URLs are handled incorrectly.
     255            // .
    256256            array( '//[::FFFF::127.0.0.1]/', PHP_URL_HOST, '[::FFFF::127.0.0.1]' ),
    257257            array( '//[::FFFF::127.0.0.1]/', PHP_URL_PATH, '/' ),
Note: See TracChangeset for help on using the changeset viewer.