diff --git a/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc b/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc index fe3ee02ef8..386b12c226 100644 --- a/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc +++ b/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc @@ -88,3 +88,9 @@ $instance = new class() extends SomeClass implements SomeInterface{ public function __construct() {} }; + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; +$anon = new readonly + class {}; diff --git a/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed b/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed index 4a6c5a1f1a..28b38f7086 100644 --- a/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed +++ b/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed @@ -91,3 +91,8 @@ $instance = new class () extends SomeClass implements { public function __construct() {} }; + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; +$anon = new readonly class {}; diff --git a/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php b/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php index 06104444ae..240352704f 100644 --- a/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php +++ b/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php @@ -55,6 +55,8 @@ public function getErrorList() 75 => 1, 87 => 1, 88 => 1, + 94 => 1, + 96 => 1, ]; }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc b/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc index eb724505eb..da47fa179e 100644 --- a/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc +++ b/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc @@ -12,3 +12,5 @@ ReadOnly class MyClass } $a = new CLASS() {}; + +$anon = new ReadOnly class() {}; diff --git a/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed b/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed index 672fdfb3c4..0c18bc86b7 100644 --- a/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed +++ b/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed @@ -12,3 +12,5 @@ readonly class MyClass } $a = new class() {}; + +$anon = new readonly class() {}; diff --git a/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php b/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php index 9bbc66fb1d..7fc45e786b 100644 --- a/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php +++ b/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php @@ -40,6 +40,7 @@ public function getErrorList() 10 => 1, 11 => 1, 14 => 1, + 16 => 1, ]; return $errors; diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc index a76f42fef4..49eaa2b633 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc +++ b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc @@ -139,3 +139,11 @@ class ReadonlyTest { public function __construct(readonly protected float|int $x, public readonly?string &$y = 'test') {} } + +// PHP 8.2 readonly classes. +readonly class ReadonlyClassTest {} +readonly class ReadonlyClassTest {} + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed index 7fd80626d5..4c116c76ad 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed +++ b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed @@ -133,3 +133,11 @@ class ReadonlyTest { public function __construct(readonly protected float|int $x, public readonly ?string &$y = 'test') {} } + +// PHP 8.2 readonly classes. +readonly class ReadonlyClassTest {} +readonly class ReadonlyClassTest {} + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php index 52bd129ace..cc58d4e797 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php @@ -56,6 +56,8 @@ public function getErrorList($testFile='') 134 => 2, 138 => 2, 140 => 3, + 145 => 1, + 149 => 1, ]; case 'ScopeKeywordSpacingUnitTest.3.inc':