From 1f28106a140c6a3a6c5b5675d647f7c0ef6788aa Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 24 Jan 2023 16:03:26 +0000 Subject: [PATCH] Code Modernization: Rename parameters that use reserved keywords in `phpunit/tests/kses.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 `$global` parameter to `$global_name` in `Tests_Kses::test_kses_globals_are_defined()`. Follow-up to [52229], [54203], [55090]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #56788. git-svn-id: https://develop.svn.wordpress.org/trunk@55131 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/kses.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index b31f477661..8843903aff 100644 --- a/tests/phpunit/tests/kses.php +++ b/tests/phpunit/tests/kses.php @@ -2092,10 +2092,10 @@ HTML; * * @ticket 54060 * - * @param string $global The name of the global variable. + * @param string $global_name The name of the global variable. */ - public function test_kses_globals_are_defined( $global ) { - $this->assertArrayHasKey( $global, $GLOBALS ); + public function test_kses_globals_are_defined( $global_name ) { + $this->assertArrayHasKey( $global_name, $GLOBALS ); } /** @@ -2104,13 +2104,13 @@ HTML; * @return array */ public function data_kses_globals_are_defined() { - $globals = array( + $required_kses_globals = array( 'allowedposttags', 'allowedtags', 'allowedentitynames', 'allowedxmlentitynames', ); - return $this->text_array_to_dataprovider( $globals ); + return $this->text_array_to_dataprovider( $required_kses_globals ); } }