Skip to content

PHP 8.1: add support for readonly properties - #363

Merged
jrfnl merged 2 commits into
developfrom
php-8.1/add-support-for-readonly-properties
Oct 15, 2022
Merged

jrfnl merged 2 commits into
developfrom
php-8.1/add-support-for-readonly-properties

Conversation

@jrfnl

@jrfnl jrfnl commented Oct 15, 2022

Copy link
Copy Markdown
Member

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

Development

Successfully merging this pull request may close these issues.

1 participant