Skip to content

Commit d541631

Browse files
committed
NamingConventions/PrefixAllGlobals: modify a test to use readonly anonymous classes
This commit modifies an existing test to use readonly anonymous classes to the `WordPress.NamingConventions.PrefixAllGlobals` tests. This is just to ensure that the part of the sniff code that checks for `T_ANON_CLASS` tokens works correctly with readonly anonymous class added in PHP 8.3. The sniff was already handling readonly anonymous classes correctly, and no change to the sniff code is needed.
1 parent 0620684 commit d541631

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.1.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class Acronym_Example {
137137
function do_something( $param = 'default' ) {}
138138
}
139139

140-
$acronym_class = new class {
140+
$acronym_class = new readonly class {
141141
const SOME_CONSTANT = 'value';
142142

143143
public $var = 'abc';

0 commit comments

Comments
 (0)