Skip to content

PEAR.Functions.FunctionCallSignature broken when closure uses return types #835

@Majkl578

Description

@Majkl578

The following code is considered as invalid:

<?php

array_filter(
    [1, 2],
    function ($i) : bool {
        return $i === 0;
    }
);

Although the indenation is correct, the error is generated: Multi-line function call not indented correctly; expected 4 spaces but found 8. Note that when you remove : bool, it works fine.
Affects phpcbf as well (changes code to invalid format).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions