-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create special case for T_BAD_CHARACTER constant (#1586)
The `T_BAD_CHARACTER` constant was removed in PHP 7.0 and re-added in PHP 7.4. This led to confusing error messages from the PHPCompatibility `NewConstants` and `RemovedConstants` sniffs, which would report the constant as removed, but also as not available yet (new). This PR fixes this by special casing the handling of the `T_BAD_CHARACTER` constant in both the `NewConstants` as well as the `RemovedConstants` sniffs with a special error message which is only shown when PHP 7.0 - 7.3 needs to be support and not when only PHP < 7.0 or PHP 7.4+ needs to be supported. Includes dedicated unit tests to verify the special casing works as expected.
- Loading branch information
Showing
4 changed files
with
146 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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