Skip to content

Commit 89f228b

Browse files
SergeyBiryukovmikachan
authored andcommitted
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56694 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 99a2b31 commit 89f228b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/phpunit/tests/media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5162,8 +5162,8 @@ static function ( $atts ) {
51625162
array( '', '<img fetchpriority="high" ' ),
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 . '"]' )
51695169
)

0 commit comments

Comments
 (0)