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.
Built from https://develop.svn.wordpress.org/trunk@58682


git-svn-id: http://core.svn.wordpress.org/trunk@58084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-07-06 14:54:16 +00:00
parent bccb3e46e1
commit 11fb201256
7 changed files with 7 additions and 14 deletions

View File

@ -1270,7 +1270,7 @@ function xfn_check( $xfn_relationship, $xfn_value = '', $deprecated = '' ) {
_deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented. _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented.
} }
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; $link_rel = isset( $link->link_rel ) ? $link->link_rel : '';
$link_rels = preg_split( '/\s+/', $link_rel ); $link_rels = preg_split( '/\s+/', $link_rel );
// Mark the specified value as checked if it matches the current link's relationship. // Mark the specified value as checked if it matches the current link's relationship.

View File

@ -6141,8 +6141,7 @@ final class WP_Customize_Manager {
* This method exists because the partial object and context data are passed * This method exists because the partial object and context data are passed
* into a partial's render_callback so we cannot use get_custom_logo() as * into a partial's render_callback so we cannot use get_custom_logo() as
* the render_callback directly since it expects a blog ID as the first * the render_callback directly since it expects a blog ID as the first
* argument. When WP no longer supports PHP 5.3, this method can be removed * argument.
* in favor of an anonymous function.
* *
* @see WP_Customize_Manager::register_controls() * @see WP_Customize_Manager::register_controls()
* *

View File

@ -73,7 +73,7 @@ class WP_Object_Cache {
private $multisite; private $multisite;
/** /**
* Sets up object properties; PHP 5 style constructor. * Sets up object properties.
* *
* @since 2.0.8 * @since 2.0.8
*/ */

View File

@ -699,12 +699,8 @@ function ms_allowed_http_request_hosts( $is_external, $host ) {
* A wrapper for PHP's parse_url() function that handles consistency in the return values * A wrapper for PHP's parse_url() function that handles consistency in the return values
* across PHP versions. * across PHP versions.
* *
* PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute URLs, including * Across various PHP versions, schemeless URLs containing a ":" in the query
* schemeless and relative URLs with "://" in the path. This function works around * are being handled inconsistently. This function works around those differences.
* those limitations providing a standard output on PHP 5.2~5.4+.
*
* Secondly, across various PHP versions, schemeless URLs containing a ":" in the query
* are being handled inconsistently. This function works around those differences as well.
* *
* @since 4.4.0 * @since 4.4.0
* @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`. * @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`.

View File

@ -453,8 +453,6 @@ function wp_is_maintenance_mode() {
/** /**
* Gets the time elapsed so far during this PHP script. * Gets the time elapsed so far during this PHP script.
* *
* Uses REQUEST_TIME_FLOAT that appeared in PHP 5.4.0.
*
* @since 5.8.0 * @since 5.8.0
* *
* @return float Seconds since the PHP script started. * @return float Seconds since the PHP script started.

View File

@ -709,7 +709,7 @@ class WP_REST_Request implements ArrayAccess {
* Parses the request body parameters. * Parses the request body parameters.
* *
* Parses out URL-encoded bodies for request methods that aren't supported * Parses out URL-encoded bodies for request methods that aren't supported
* natively by PHP. In PHP 5.x, only POST has these parsed automatically. * natively by PHP.
* *
* @since 4.4.0 * @since 4.4.0
*/ */

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.7-alpha-58681'; $wp_version = '6.7-alpha-58682';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.