Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Nov 2, 2020

PHP 8 introduces constructor property promotion.

This commit adds support for constructor property promotion to the File::getMethodParameters() method.

This change introduces two new keys - property_visibility and visibility_token - to the return array which will only be included if constructor property promotion is detected.

The method does not check whether property promotion is valid in the function/method in which it is used. That is not the concern of this method.

Includes unit tests.

Ref: https://wiki.php.net/rfc/constructor_promotion

Implementation as discussed in #2968. Partially fixes #2968.

…tor property promotion PHP 8 introduces constructor property promotion. This commit adds support for constructor property promotion to the `File::getMethodParameters()` method. This change introduces two new keys - `property_visibility` and `visibility_token` - to the return array which will only be included if constructor property promotion is detected. The method does not check whether property promotion is _valid_ in the function/method in which it is used. That is not the concern of this method. Includes unit tests. Ref: https://wiki.php.net/rfc/constructor_promotion
@gsherwood gsherwood added this to the 3.6.0 milestone Nov 2, 2020
gsherwood added a commit that referenced this pull request Nov 2, 2020
@gsherwood gsherwood merged commit 7d09dc4 into squizlabs:master Nov 2, 2020
@gsherwood
Copy link
Member

Thanks for adding this support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants