Closed
Conversation
9f3968c to
1a6dc95
Compare
12fcc3c to
93b53d0
Compare
c56ef1e to
b5e1356
Compare
159cbbc to
301638f
Compare
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization of fully qualified function/method calls when checking if the sniff can determine the key used to retrieve a value from the `$GLOBALS` array. The sniff was already handling this correct by chance due to a check that happens later in the code execution to bow out if `$var_name` is empty.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization of fully qualified function calls when checking if a nonce verification function is used in the code.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when skipping over function calls while checking the hook name.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when checking if a given fully qualified function is a target function. In those cases, the leading backslash is removed from the token content to allow for the function name comparisons to continue working as they worked in PHPCS 3.x.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when checking for calls to `define()` and hook functions to handle fully qualified calls correctly.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when checking if a given token is a target token.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when checking function calls after the `T_ASPERAND` token.
…fully qualified `\false` and `\null`
Check the way the tests are structured. There is for sure room to improve their organization. Also check the way that I'm running the tests in the WordPress/Util/Tests in composer.json and the need to add a custom autoloader to bootstrap.php. There is probably a better way to achieve both.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when determining the name of the function being called.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when checking if a WP time constant was used.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when checking if a PHP native array key exists function was used.
…ive in constant alias This method was incorrectly identifying constant alias as the use of a global constant which is incorrect. This change aligns this method with how the sibling method in PHPCompatibility behaves.
Check the way the tests are structured. There is for sure room to improve their organization.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when determining if a constant is global or not.
Check the way the tests are structured. There is for sure room to improve their organization.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when determining if a token is namespaced or not. Since the tokenization of namespaced names changed between PHPCS 3 and 4, it was necessary to use different logic depending on the PHPCS version. TODO check if the approach to support both PHPCS 3 and 4 is good.
Add tests safeguarding that namespaced calls to functions named `define` are handled correctly.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization when checking the name of a given constants to see if it is one of the discouraged constants and when checking if `define()` was called.
…es are handled correctly There were already a few tests with namespaced names, so this commit adds only what was missing in the existing tests.
The tokenization of (namespaced) "names" has changed in PHP 8.0, and this new tokenization will come into effect for PHP_CodeSniffer as of version 4.0.0. This commit adds handling for the new tokenization to this sniff. Discuss if it is worth supporting `\true` and `\false` (and maybe even `\null`) in this sniff.
514b97f to
22533c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating this PR to test the GH action changes.