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

PEAR/FunctionDeclaration: bug fix x 2 - prevent fixer creating a parse error + prevent fixer conflict #3739

Commits on May 4, 2023

  1. PEAR/FunctionDeclaration: bug fix - prevent fixer from creating a par…

    …se error
    
    Issue as described in 3736.
    
    The fixer would try to remove superfluous whitespace remaining after the move of the opening brace to the previous line, but did not take into account that there may not be any whitespace to removed, i.e. that the `$opener +1` token could be the same as the `$next` token.
    
    Fixed now.
    
    Includes unit test.
    
    Fixes 3736
    jrfnl committed May 4, 2023
    Configuration menu
    Copy the full SHA
    4845ef0 View commit details
    Browse the repository at this point in the history
  2. PEAR/FunctionDeclaration: prevent fixer conflict

    If a return type declaration was not confined to one line, the sniff could have a fixer conflict with itself.
    The fixer would also potentially remove a close curly on the same line, causing parse errors.
    
    Fixed now. The diff will be most straight forward to review while ignoring whitespace changes.
    
    Includes unit tests.
    jrfnl committed May 4, 2023
    Configuration menu
    Copy the full SHA
    a498afb View commit details
    Browse the repository at this point in the history