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

Undefined Offset notice during live coding of arrow functions #2805

Merged

Commits on Jan 10, 2020

  1. PHP Tokenizer: fix "undefined offset" notice during live coding / arr…

    …ow functions
    
    Defensive coding for the arrow functions backfill. This fixes a number of "undefined index" PHP notices when arrow functions are being declared during live coding.
    
    ```
    Notice: Undefined offset: 561 in /path/to/PHP_CodeSniffer/src/Tokenizers/PHP.php on line 1807
    Notice: Undefined offset: 561 in /path/to/PHP_CodeSniffer/src/Tokenizers/PHP.php on line 1808
    Notice: Undefined offset: 561 in /path/to/PHP_CodeSniffer/src/Tokenizers/PHP.php on line 1815
    ```
    
    It also fixes a bug where an inner for loop was using the wrong variable for the condition part.
    
    Includes adjusted unit test + additional unit test covering all changes.
    
    Includes minor documentation fix.
    jrfnl committed Jan 10, 2020
    Configuration menu
    Copy the full SHA
    332e094 View commit details
    Browse the repository at this point in the history