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.0 | File::getMethodParameters(): add support for PHP 8 constructor property promotion #3152

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PHP 8's mixed type
2 participants