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: examine arrow function declarations + fix fixer conflict #3661

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on May 4, 2023

  1. PEAR/FunctionDeclaration: examine arrow function declarations

    PHP 7.4 arrow functions were not yet being taken into account for this sniff.
    
    Fixed now.
    Includes unit tests.
    jrfnl committed May 4, 2023
    Configuration menu
    Copy the full SHA
    eced441 View commit details
    Browse the repository at this point in the history
  2. Squiz/MultiLineFunctionDeclaration: add tests for arrow function decl…

    …arations
    
    The Squiz sniff inherits the change from the `PEAR.Functions.FunctionDeclaration` sniff.
    
    This commit adds tests to document the behaviour and safeguard the inherited change.
    jrfnl committed May 4, 2023
    Configuration menu
    Copy the full SHA
    db548df View commit details
    Browse the repository at this point in the history
  3. 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
    d479811 View commit details
    Browse the repository at this point in the history