Skip to content

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Apr 20, 2021

Type declarations can use namespace relative Types, i.e. namespace\Sub\Name.

However, in that case, the T_BITWISE_OR token was incorrectly not converted to T_TYPE_UNION.

Includes unit tests.
Includes additional tests with all other "namespaced identifier name" types to safeguard this for the PHPCS 4.x change to the PHP 8.0 tokenization of identifier names.

Note: the tests should be forward-ported to the 4.x branch. The change to the Tokenizer/PHP file should not.

Type declarations can use namespace relative Types, i.e. `namespace\Sub\Name`. However, in that case, the `T_BITWISE_OR` token was incorrectly not converted to `T_TYPE_UNION`. Includes unit tests. Includes additional tests with all other "namespaced identifier name" types to safeguard this for the PHPCS 4.x change to the PHP 8.0 tokenization of identifier names.
@gsherwood gsherwood added this to the 3.6.1 milestone Apr 23, 2021
gsherwood added a commit that referenced this pull request Apr 23, 2021
@gsherwood gsherwood merged commit 4eeb4dd into squizlabs:master Apr 23, 2021
@gsherwood
Copy link
Member

Thanks for finding and fixing this. Merged into 4.0 as per instructions and all went well.

@jrfnl jrfnl deleted the feature/tokenizer-php-bugfix-namespaced-type-decl-vs-union-types branch April 23, 2021 04:39
@jrfnl jrfnl mentioned this pull request Nov 20, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants