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.1: add support for readonly properties #363

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 15, 2022

PHP 8.1 | BCFile/FunctionDeclarations::get[Method]Parameters(): allow for readonly keyword

... in constructor property promotion.

Note: the property_readonly key will always be added when constructor property promotion has been detected. The readonly_token only when the readonly token has actually been found.

Includes unit tests.

Ref:

PHP 8.1 | Variables::getMemberProperties(): detect if property is readonly

Includes:

  • Updating the Collections::$propertyModifierKeyword property to allow for the T_READONLY token.

Includes unit tests.

Ref:

jrfnl and others added 2 commits October 15, 2022 07:51
… for readonly keyword

> ... in constructor property promotion.
>
> Note: the `property_readonly` key will always be added when constructor property promotion has been detected. The `readonly_token` only when the `readonly` token has actually been found.
>
> Includes unit tests.

Ref:
* squizlabs/PHP_CodeSniffer 3516
…donly

Includes:
* Updating the `Collections::$propertyModifierKeyword` property to allow for the `T_READONLY` token.

Includes unit tests.

Ref:
* squizlabs/PHP_CodeSniffer 3480
* squizlabs/PHP_CodeSniffer 3513
* squizlabs/PHP_CodeSniffer 3515
* squizlabs/PHP_CodeSniffer 3584

Co-authored-by: Jaroslav Hanslík <kukulich@kukulich.cz>
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