From 1aaf68db85a21ba9669b51ffc2d21c05e2d95911 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 29 Mar 2022 13:21:08 +0000 Subject: [PATCH] Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/class-wp-filesystem-base.php`. While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names. This commit renames the `$echo` parameter to `$verbose` in `WP_Filesystem_Base::find_base_dir()` and `::get_base_dir()`, and updates the documentation accordingly. This matches the class property of the same name. Follow-up to [52946], [52996], [52997], [52998], [53003]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #55327. Built from https://develop.svn.wordpress.org/trunk@53014 git-svn-id: http://core.svn.wordpress.org/trunk@52603 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-base.php | 17 ++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php index de5ce054cf..221f8b59f5 100644 --- a/wp-admin/includes/class-wp-filesystem-base.php +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -129,14 +129,13 @@ class WP_Filesystem_Base { * @see WP_Filesystem_Base::wp_themes_dir() * @see WP_Filesystem_Base::wp_lang_dir() * - * @param string $base The folder to start searching from. - * @param bool $echo True to display debug information. - * Default false. + * @param string $base Optional. The folder to start searching from. Default '.'. + * @param bool $verbose Optional. True to display debug information. Default false. * @return string The location of the remote path. */ - public function find_base_dir( $base = '.', $echo = false ) { + public function find_base_dir( $base = '.', $verbose = false ) { _deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' ); - $this->verbose = $echo; + $this->verbose = $verbose; return $this->abspath(); } @@ -151,13 +150,13 @@ class WP_Filesystem_Base { * @see WP_Filesystem_Base::wp_themes_dir() * @see WP_Filesystem_Base::wp_lang_dir() * - * @param string $base The folder to start searching from. - * @param bool $echo True to display debug information. + * @param string $base Optional. The folder to start searching from. Default '.'. + * @param bool $verbose Optional. True to display debug information. Default false. * @return string The location of the remote path. */ - public function get_base_dir( $base = '.', $echo = false ) { + public function get_base_dir( $base = '.', $verbose = false ) { _deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' ); - $this->verbose = $echo; + $this->verbose = $verbose; return $this->abspath(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 396fc0154a..e79bbb3b9a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53012'; +$wp_version = '6.0-alpha-53014'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.