Skip to content

Require trailing comma rules do not enforce trailing comma in match statement #1821

@LucasdeRijke

Description

@LucasdeRijke

I have all trailing comma rules enabled but i noticed that these rules are not enforced in a match expression. Is this expected behaviour?

Currently this will not throw an error with all trialing comma rules enabled

match ($this) {
    self::bread => food::bread,
    self::pizza => food::pizza,
    default => throw new LogicException()
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions