Skip to content

Commit

Permalink
PHP 8.2 | Squiz/ClassDeclaration: allow for readonly classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed May 18, 2023
1 parent 3441ef9 commit 3f7b9ba
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function processOpen(File $phpcsFile, $stackPtr)

if ($tokens[($stackPtr - 2)]['code'] !== T_ABSTRACT
&& $tokens[($stackPtr - 2)]['code'] !== T_FINAL
&& $tokens[($stackPtr - 2)]['code'] !== T_READONLY
) {
if ($spaces !== 0) {
$type = strtolower($tokens[$stackPtr]['content']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,12 @@ class IncorrectCodeBeforeClosingBrace
{

echo phpinfo();}

readonly
class Test
{
}

readonly class Test
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,11 @@ class IncorrectCodeBeforeClosingBrace

echo phpinfo();
}

readonly class Test
{
}

readonly class Test
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public function getErrorList()
116 => 1,
118 => 1,
121 => 1,
124 => 2,
128 => 2,
];

}//end getErrorList()
Expand Down

0 comments on commit 3f7b9ba

Please sign in to comment.