PHP 8.3 | Add tests with readonly anonymous classes to various sniffs #323
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
PHP 8.3 | Squiz/LowercaseClassKeywords: add tests with readonly anonymous classes
Sniff already handles this and handles it correctly.
PHP 8.2/8.3 | Squiz/ScopeKeywordSpacing: add tests with readonly classes
Adds test for both plain readonly classes (PHP 8.2) as well as anonymous readonly classes (PHP 8.3).
Sniff already handles this and handles it correctly.
PHP 8.3 | PSR12/AnonClassDeclaration: add tests with readonly anonymous classes
The underlying
PSR2.Classes.ClassDeclaration
sniff, which does the actual checking of the space between a potential modifier keyword and theclass
keyword, already handles this correctly (after squizlabs/PHP_CodeSniffer#3826 and #307).Note: tests were only added to the PSR12 sniffs as that sniffs registers the
T_ANON_CLASS
token.The
PEAR.Classes.ClassDeclaration
sniff and thePSR2
andSquiz
versions, which both extend thePEAR
class, don't need tests as none of those listen for theT_ANON_CLASS
token.Suggested changelog entry
N/A
Related issues/external references
Related to #106