Skip to content

Symfony.Objects.ObjectInstantiation.Invalid rejects new class () #200

@Bilge

Description

@Bilge

PSR-12 sniff, PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword rejects new class() with: Expected 1 space after class keyword; 0 found.

However, Symfony.Objects.ObjectInstantiation.Invalid rejects new class () with: Use parentheses when instantiating classes.

It seems to me this is a bug in this sniff, because to be so satisfied, this sniff should only be concerned with the presence of parens, not the formatting thereof. Ergo it should not be attempting to enforce that the parens are adjacent to class, but currently it has that (unwanted) side-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