Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextStrings::getCompleteTextString(): add BC for incorrectly tokenized double quoted strings #317

Commits on Jun 2, 2022

  1. TextStrings::getCompleteTextString(): add BC for incorrectly tokenize…

    …d double quoted strings
    
    While creating a sniff for PHPCompatibility to detect the PHP 8.2 deprecation of two of the four syntaxes to embed variables/expressions within text strings, I realized that for select examples of the "type 4" syntax - "Variable variables (`“${expr}”`, equivalent to (string) `${expr})`" -, PHPCS did not, and probably never did, tokenize those correctly in PHPCS itself.
    
    A fix for this has been pulled to PHPCS in PR squizlabs/PHP_CodeSniffer 3604.
    
    This commit ensures that the `TextStrings::getCompleteTextString()` method handles double quoted strings affected by this tokenizer bug correctly in all supported PHPCS versions.
    
    Includes dedicated tests specifically for the handling of embedded variables/expressions in double quoted strings.
    jrfnl committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    c9c0266 View commit details
    Browse the repository at this point in the history