Skip to content

is_token_namespaced() doesn't take into account __NAMESPACE__ concatenation #1

Open
@rebeccahum

Description

@rebeccahum

👋 When using the helper function is_token_namespaced(), it doesn't appear to pick up when the magic constant of __NAMESPACE__ is being concatenated:

https://github.com/WordPress/WordPress-Coding-Standards/blob/06966b26d8deb06a91a5c0f99a04802a6ff5e5bf/WordPress/Sniff.php#L1648-L1671

e.g. The below would return false:

__NAMESPACE__ . '\FOO_BAR';

I think we can just add a check if the token is T_NS_C.

Please let me know if I can provide any additional information!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions