Skip to content

Formatter removes whitespace after colon when named argument is called "empty" #174

@metanomial

Description

@metanomial

e.g.,

Before formatting:

function foo() {
    bar(
        baz: 42,
        qux: 'hello',
        corge: [1, 2, 3],
        empty: false,
    );
    bar(baz: 42, qux: 'hello', corge: [1, 2, 3], empty: true);
}

function bar(
    int $baz,
    string $qux,
    mixed $corge,
    bool $empty,
) {
    noop();
}

After formatting:

function foo() {
    bar(
        baz: 42,
        qux: 'hello',
        corge: [1, 2, 3],
        empty:false,
    );
    bar(baz: 42, qux: 'hello', corge: [1, 2, 3], empty:true);
}

function bar(
    int $baz,
    string $qux,
    mixed $corge,
    bool $empty,
) {
    noop();
}

This one is baffling to me. Disabling all default passes has no effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions