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

Tokenizer/PHP: fix mis-identification of 'readonly' keyword icw PHP 8.2 DNF types #34

Merged
merged 2 commits into from
Nov 9, 2023

Commits on Nov 9, 2023

  1. Tokenizer/PHP: add some extra tests for the readonly keyword backfill

    Includes some minor tweaks to pre-existing tests.
    jrfnl committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    8f43103 View commit details
    Browse the repository at this point in the history
  2. Fix mis-identification of 'readonly' keyword

    PHP 8.2 introduces disjunctive normal form types, which use parentheses, which invalidates the previous "special casing" for function/method declarations and calls using the `readonly` keyword.
    
    This commit fixes this.
    
    Note: this does not (yet) add support for DNF types to the tokenizer or anywhere else in PHPCS, it only fixes the tokenization of `readonly`.
    
    Includes additional tests.
    
    Ref: php/php-src@08b7539
    
    Co-authored-by: Dan Wallis <dan@wallis.nz>
    jrfnl and fredden committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    1858e46 View commit details
    Browse the repository at this point in the history