From 11fb20125645001874150ecfdba972236248518e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 6 Jul 2024 14:54:16 +0000 Subject: [PATCH] Code Modernization: Remove obsolete comments about older PHP versions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- wp-admin/includes/meta-boxes.php | 2 +- wp-includes/class-wp-customize-manager.php | 3 +-- wp-includes/class-wp-object-cache.php | 2 +- wp-includes/http.php | 8 ++------ wp-includes/load.php | 2 -- wp-includes/rest-api/class-wp-rest-request.php | 2 +- wp-includes/version.php | 2 +- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 43e33445d6..dc363716d5 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -1270,7 +1270,7 @@ function xfn_check( $xfn_relationship, $xfn_value = '', $deprecated = '' ) { _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 ); // Mark the specified value as checked if it matches the current link's relationship. diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 8efcfc129b..906ce4cf67 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -6141,8 +6141,7 @@ final class WP_Customize_Manager { * 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 * 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 - * in favor of an anonymous function. + * argument. * * @see WP_Customize_Manager::register_controls() * diff --git a/wp-includes/class-wp-object-cache.php b/wp-includes/class-wp-object-cache.php index 8136ea3ad9..6086ddf0d9 100644 --- a/wp-includes/class-wp-object-cache.php +++ b/wp-includes/class-wp-object-cache.php @@ -73,7 +73,7 @@ class WP_Object_Cache { private $multisite; /** - * Sets up object properties; PHP 5 style constructor. + * Sets up object properties. * * @since 2.0.8 */ diff --git a/wp-includes/http.php b/wp-includes/http.php index 08756f6294..26a0fc3a7e 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -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 * across PHP versions. * - * PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute URLs, including - * schemeless and relative URLs with "://" in the path. This function works around - * 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. + * Across various PHP versions, schemeless URLs containing a ":" in the query + * are being handled inconsistently. This function works around those differences. * * @since 4.4.0 * @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`. diff --git a/wp-includes/load.php b/wp-includes/load.php index 6b743d459a..e22bfb8c35 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -453,8 +453,6 @@ function wp_is_maintenance_mode() { /** * 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 * * @return float Seconds since the PHP script started. diff --git a/wp-includes/rest-api/class-wp-rest-request.php b/wp-includes/rest-api/class-wp-rest-request.php index c671fd3d13..cbe6e4e70e 100644 --- a/wp-includes/rest-api/class-wp-rest-request.php +++ b/wp-includes/rest-api/class-wp-rest-request.php @@ -709,7 +709,7 @@ class WP_REST_Request implements ArrayAccess { * Parses the request body parameters. * * 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 */ diff --git a/wp-includes/version.php b/wp-includes/version.php index 9c2df13cf3..001c7a54ff 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @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.