Skip to content

Commit

Permalink
The PHP 7.4 T_BAD_CHARACTER token has been made available for older v…
Browse files Browse the repository at this point in the history
…ersions (ref #2588)
  • Loading branch information
gsherwood committed Aug 25, 2019
1 parent 779d547 commit 96f878f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
- The T_LIST token and it's opening and closing parentheses now contain references to each other in the tokens array
-- Uses the same parenthesis_opener/closer/owner indexes as other tokens
-- Thanks to Juliette Reinders Folmer for the patch
- The PHP 7.4 T_BAD_CHARACTER token has been made available for older versions
-- Allows you to safely look for this token, but it will not appear unless checking with PHP 7.4+

This comment has been minimized.

Copy link
@jrfnl

jrfnl Aug 25, 2019

Contributor

or PHP < 7.0.

This comment has been minimized.

Copy link
@gsherwood

gsherwood Aug 25, 2019

Author Member

I checked that but got nothing on older versions: https://3v4l.org/TZOIA

This comment has been minimized.

Copy link
@jrfnl

jrfnl Aug 25, 2019

Contributor

Fair enough. Weird though, cause the token did exist. Not sure when (if ever) it was used before.

- Added Generic.ControlStructures.DisallowYodaConditions sniff
-- Ban the use of Yoda conditions
-- Thanks to Mponos George for the contribution
Expand Down
5 changes: 5 additions & 0 deletions src/Util/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@
define('T_YIELD_FROM', 'PHPCS_T_YIELD_FROM');
}

// Some PHP 7.4 tokens, replicated for lower versions.
if (defined('T_BAD_CHARACTER') === false) {
define('T_BAD_CHARACTER', 'PHPCS_T_BAD_CHARACTER');
}

// Tokens used for parsing doc blocks.
define('T_DOC_COMMENT_STAR', 'PHPCS_T_DOC_COMMENT_STAR');
define('T_DOC_COMMENT_WHITESPACE', 'PHPCS_T_DOC_COMMENT_WHITESPACE');
Expand Down

0 comments on commit 96f878f

Please sign in to comment.