Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.3 | Add tests with readonly anonymous classes to various sniffs #323

Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Feb 2, 2024

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 the class 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 the PSR2 and Squiz versions, which both extend the PEAR class, don't need tests as none of those listen for the T_ANON_CLASS token.

Suggested changelog entry

N/A

Related issues/external references

Related to #106

…mous classes

Sniff already handles this and handles it correctly.
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.
…us classes

The underlying `PSR2.Classes.ClassDeclaration` sniff, which does the actual checking of the space between a potential modifier keyword and the `class` 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 the `PSR2` and `Squiz` versions, which both extend the `PEAR` class, don't need tests as none of those listen for the `T_ANON_CLASS` token.
@jrfnl jrfnl added this to the 3.9.0 milestone Feb 2, 2024
@jrfnl jrfnl mentioned this pull request Feb 2, 2024
7 tasks
@jrfnl jrfnl merged commit 000c0cf into master Feb 2, 2024
46 checks passed
@jrfnl jrfnl deleted the php-8.3/readonly-anon-classes-add-tests-to-various-sniffs branch February 2, 2024 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant