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

PHPCS 4.x | Sync with upstream changes regarding PHP 8 identifier names #241

Merged
merged 4 commits into from
Dec 22, 2020

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 22, 2020

PHPCS 4.x | Collections/various methods: sync with PHPCS

Upstream PR squizlabs/PHP_CodeSniffer#3155 for PHPCS 4.x backfills the PHP 8.0 tokenization for identifier names for older PHP versions, including backfilling the PHP 8.0 token constants.

This commit updates the unit tests for various token collections to handle this correctly.

Refs:

UtilityMethodTestCase::usesPhp8NameTokens(): account for PHPCS 4.x backfilling the PHP 8.0 identifier name tokenization

Upstream PR squizlabs/PHP_CodeSniffer#3155 for PHPCS 4.x backfills the PHP 8.0 tokenization for identifier names for older PHP versions.

This updates the UtilityMethodTestCase::usesPhp8NameTokens() method to take this upstream change into account.

BCTokens::functionNameTokens(): account for identifier name tokens as added in PHPCS 4.x

Upstream PR squizlabs/PHP_CodeSniffer#3155 for PHPCS 4.x adds the PHP 8.0 tokens for identifier names to the Tokens::$functionNameTokens property.

This updates the BCTokens::functionNameTokens() method to take this upstream change into account.

Includes unit tests.

Tests: fix two tests for PHP 8 identifier names

  • One test didn't yet take PHP 8 identifier names into account.
  • The other did, but contained a typo/count error.

Note: the remaining two test failures on the PHPCS 4.x branch are related to a bug upstream - see PR squizlabs/PHP_CodeSniffer#3104

@jrfnl jrfnl added this to the 1.0.0-alpha4 milestone Dec 22, 2020
@jrfnl jrfnl force-pushed the collections/sync-with-phpcs-4.x-identifier-names branch 2 times, most recently from a40b929 to 3b9adba Compare December 22, 2020 20:11
Upstream PR 3155 for PHPCS 4.x backfills the PHP 8.0 tokenization for identifier names for older PHP versions, including backfilling the PHP 8.0 token constants.

This commit updates the unit tests for various token collections to handle this correctly.

Refs:
* squizlabs/PHP_CodeSniffer 3041
* squizlabs/PHP_CodeSniffer 3155
…ckfilling the PHP 8.0 identifier name tokenization

Upstream PR 3155 for PHPCS 4.x backfills the PHP 8.0 tokenization for identifier names for older PHP versions.

This updates the `UtilityMethodTestCase::usesPhp8NameTokens()` method to take this upstream change into account.
@jrfnl jrfnl force-pushed the collections/sync-with-phpcs-4.x-identifier-names branch from 3b9adba to 22c1d49 Compare December 22, 2020 20:31
… added in PHPCS 4.x

Upstream PR 3155 for PHPCS 4.x adds the PHP 8.0 tokens for identifier names to the `Tokens::$functionNameTokens` property.

This updates the `BCTokens::functionNameTokens()` method to take this upstream change into account.

Includes unit tests.
* One test didn't yet take PHP 8 identifier names into account.
* The other did, but contained a typo/count error.
@jrfnl jrfnl force-pushed the collections/sync-with-phpcs-4.x-identifier-names branch from 22c1d49 to 5c69cbb Compare December 22, 2020 22:09
@jrfnl jrfnl merged commit 3f1a79a into develop Dec 22, 2020
@jrfnl jrfnl deleted the collections/sync-with-phpcs-4.x-identifier-names branch December 22, 2020 22:19
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.

None yet

1 participant