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

Generic/MultipleStatementAlignment: fix bug/list syntax before assignment operator #1924

Merged

Commits on Mar 6, 2018

  1. Generic/MultipleStatementAlignment: fix bug/list syntax before assign…

    …ment operator
    
    This simplifies the fixes which were previously committed to fix 1870 and 1848, which were released in `3.2.3`.
    
    Both those fixes try to prevent the sniff getting confused over (potentially) multi-line value assignments, such as closures and arrays.
    
    The simplification removes the previously added code in favour of skipping to the end of a statement as soon as an assignment operator has been found.
    
    This might also make the sniff marginally faster as the tokens between the assignment operator and the end of the statement will no longer be examined.
    
    N.B.: The reason for going one back from the end of the assignment, is that otherwise the code addressing the unit test on line 220 / added in commit 579d39c would not be triggered, leading to incorrect results.
    
    Side-note: I think it would be a good idea to add unit tests for the `File::findEndOfStatement()` method.
    jrfnl committed Mar 6, 2018
    Configuration menu
    Copy the full SHA
    7fb368d View commit details
    Browse the repository at this point in the history