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.2: add support for DNF types #604

Merged
merged 5 commits into from
May 20, 2024
Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented May 20, 2024

PHP 8.2 | Collections: add support for DNF types

Upstream PR PHPCSStandards/PHP_CodeSniffer#387 introduced support for DNF types to PHPCS itself, introducing two new tokens for the DNF parentheses: T_TYPE_OPEN_PARENTHESIS and T_TYPE_CLOSE_PARENTHESIS.

This commit adds these new tokens to the appropriate token collections in the Collections class.

This will automatically add support for DNF types to various methods in PHPCSUtils.

Includes updated unit tests.

PHP 8.2 | BCFile/FunctionDeclarations::get[Method]Parameters(): add support for DNF types

The changes in the BCFile class mirror the upstream changes.

As for the FunctionDeclarations class: support was automatically added when the Collections::parameterTypeTokens() were updated.

Includes tests.

Closes #567

PHP 8.2 | BCFile/FunctionDeclarations::get[Method]Properties(): add tests for DNF types

The BCFile method inherits the necessary changes from PHPCS 3.10.0..

As for the FunctionDeclarations class: support was automatically added when the Collections::returnTypeTokens() were updated.

Includes tests.

PHP 8.2 | BCFile/Variables::getMemberProperties(): add tests for DNF types

The BCFile method inherites the necessary changes from PHPCS 3.10.0..

As for the Variables class: support was automatically added when the Collections::propertyTypeTokens() were updated.

Includes tests.

IsReferenceTest: add extra tests with intersection/DNF types

jrfnl added 2 commits May 20, 2024 13:42
Upstream PR PHPCSStandards/PHP_CodeSniffer 387 introduced support for DNF types to PHPCS itself, introducing two new tokens for the DNF parentheses: `T_TYPE_OPEN_PARENTHESIS` and `T_TYPE_CLOSE_PARENTHESIS`.

This commit adds these new tokens to the appropriate token collections in the `Collections` class.

This will automatically add support for DNF types to various methods in PHPCSUtils.

Includes updated unit tests.
…upport for DNF types

The changes in the `BCFile` class mirror the upstream changes.

As for the `FunctionDeclarations` class: support was automatically added when the `Collections::parameterTypeTokens()` were updated.

Includes tests.

Closes 567
@jrfnl jrfnl added this to the 1.0.12 milestone May 20, 2024
@jrfnl jrfnl changed the title PHP 8.2: add support for dnf types PHP 8.2: add support for DNF types May 20, 2024
jrfnl added 3 commits May 20, 2024 14:37
…ests for DNF types

The `BCFile` method inherites the necessary changes from PHPCS 3.10.0..

As for the `FunctionDeclarations` class: support was automatically added when the `Collections::returnTypeTokens()` were updated.

Includes tests.
…types

The `BCFile` method inherites the necessary changes from PHPCS 3.10.0..

As for the `Variables` class: support was automatically added when the `Collections::propertyTypeTokens()` were updated.

Includes tests.
@jrfnl jrfnl force-pushed the php-8.2/add-support-for-dnf-types branch from 163436e to a631970 Compare May 20, 2024 12:37
@jrfnl jrfnl merged commit f6b22f6 into develop May 20, 2024
54 checks passed
@jrfnl jrfnl deleted the php-8.2/add-support-for-dnf-types branch May 20, 2024 12:42
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.

1 participant