2072 / PHP-Indenting-for-VIm

The official VIm indent script for PHP
http://www.2072productions.com/to/phpindent.txt
128 stars 29 forks source link

Incorrect indentation for multi-line function declarations with annotated returns #64

Closed quexxon closed 6 years ago

quexxon commented 6 years ago

Multi-line function declarations with an annotated return and the opening brace on the same line as the closing parentheses have incorrectly indented bodies. Note that the behavior is correct if the type annotation for the return is omitted.

Example

Current Behavior

function add(
    int $x,
    int $y
): int {
return $x + $y;
}

Expected Behavior

function add(
    int $x,
    int $y
): int {
    return $x + $y;
}
2072 commented 6 years ago

This should be fixed now. Thanks for reporting this!