Skip to content
New issue

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

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

Already on GitHub? # to your account

PHP 8.2 | Scopes::isOOConstant(): add support for constants in traits #366

Merged
merged 1 commit into from
Oct 15, 2022

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 15, 2022

As of PHP 8.2, it is allowed to declare constants in traits.

This commit adds support for detecting whether a constant declared using the const keyword is within an trait structure to the Scopes::isOOConstant() method.

Includes adding the T_TRAIT token to the Collections::ooConstantScopes() token array.

Refs:

As of PHP 8.2, it is allowed to declare constants in traits.

This commit adds support for detecting whether a constant declared using the `const` keyword is within an trait structure to the `Scopes::isOOConstant()` method.

Includes adding the `T_TRAIT` token to the `Collections::ooConstantScopes()` token array.

Refs:
* https://wiki.php.net/rfc/constants_in_traits
@jrfnl jrfnl added this to the 1.0.0-alpha4 milestone Oct 15, 2022
@jrfnl jrfnl merged commit 50cb535 into develop Oct 15, 2022
@jrfnl jrfnl deleted the php-8.2/add-support-constants-in-traits branch October 15, 2022 06:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant