Make WordPress Core


Ignore:
Timestamp:
09/26/2023 12:23:25 AM (10 months ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/media.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 $match parameter to $matches in shortcode image tests.

Note: This is enforced by WPCS 3.0.0.

Follow-up to [56693].

See #58831.

File:
1 edited

Legend:

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

    r56693 r56694  
    51635163                preg_replace_callback(
    51645164                    '/gallery-(\d+)/',
    5165                     static function ( $match ) {
    5166                         return 'gallery-' . ( (int) $match[1] + 1 );
     5165                    static function ( $matches ) {
     5166                        return 'gallery-' . ( (int) $matches[1] + 1 );
    51675167                    },
    51685168                    do_shortcode( '[gallery ids="' . self::$large_id . '" size="large" id="' . $post_id . '"]' )
Note: See TracChangeset for help on using the changeset viewer.