Make WordPress Core

Changeset 55131


Ignore:
Timestamp:
01/24/2023 04:03:26 PM (20 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/kses.php

    r55090 r55131  
    20932093     * @ticket 54060
    20942094     *
    2095      * @param string $global The name of the global variable.
    2096      */
    2097     public function test_kses_globals_are_defined( $global ) {
    2098         $this->assertArrayHasKey( $global, $GLOBALS );
     2095     * @param string $global_name The name of the global variable.
     2096     */
     2097    public function test_kses_globals_are_defined( $global_name ) {
     2098        $this->assertArrayHasKey( $global_name, $GLOBALS );
    20992099    }
    21002100
     
    21052105     */
    21062106    public function data_kses_globals_are_defined() {
    2107         $globals = array(
     2107        $required_kses_globals = array(
    21082108            'allowedposttags',
    21092109            'allowedtags',
     
    21122112        );
    21132113
    2114         return $this->text_array_to_dataprovider( $globals );
     2114        return $this->text_array_to_dataprovider( $required_kses_globals );
    21152115    }
    21162116}
Note: See TracChangeset for help on using the changeset viewer.