Skip to content

Collections/UtilityMethodTestCase: sync with phpcs 3.x/PHP 8.0 identifier name tokens change#217

Merged
jrfnl merged 2 commits intodevelopfrom
collections/sync-with-phpcs-3.x-identifier-names
Sep 21, 2020
Merged

Collections/UtilityMethodTestCase: sync with phpcs 3.x/PHP 8.0 identifier name tokens change#217
jrfnl merged 2 commits intodevelopfrom
collections/sync-with-phpcs-3.x-identifier-names

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Sep 20, 2020

Collections/various methods: sync with PHPCS

Upstream PR squizlabs/PHP_CodeSniffer#3063 which was merged for PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x, while it also includes backfilling the PHP 8.0 token constants.

In PHPCS 4.x the PHP 8.0 tokenization will be backfilled instead.

This commit annotates this change in the Collections::nameTokens() method and updates the unit tests for various token collections to handle this correctly as well.

Refs:

UtilityMethodTestCase::usesPhp8NameTokens(): account for PHPCS 3.x "undoing" the PHP 8.0 identifier name tokenization

Upstream PR #3063 which was merged in PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x.

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

Upstream PR 3063 which was merged in PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x, while it also includes backfilling the PHP 8.0 token constants.

In PHPCS 4.x the PHP 8.0 tokenization will be backfilled instead, but that PR has not yet been pulled.

This commit annotates the current change in the `Collections::nameTokens()` method and updates the unit tests for various token collections to handle this correctly as well.

Refs:
* squizlabs/PHP_CodeSniffer#3041
* squizlabs/PHP_CodeSniffer#3063
@jrfnl jrfnl force-pushed the collections/sync-with-phpcs-3.x-identifier-names branch from afc6674 to 91f2250 Compare September 21, 2020 00:03
…ndoing" the PHP 8.0 identifier name tokenization

Upstream PR 3063 which was merged in PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x.

This updates the `UtilityMethodTestCase::usesPhp8NameTokens()` method to take this upstream change into account.
@jrfnl jrfnl merged commit 8d7d32e into develop Sep 21, 2020
@jrfnl jrfnl deleted the collections/sync-with-phpcs-3.x-identifier-names branch September 21, 2020 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant