Skip to content

Require parentheses when constructing classes #919

Closed
@westonruter

Description

@westonruter

In WordPress's JSHint config there is an error that gets raised when you try doing this:

x = new Thing

Missing '()' invoking a constructor.

This is likewise a coding convention in WordPress's PHP to always use the parentheses when constructing a class, however this is currently not getting enforced by PHPCS. I actually haven't been able to find an existing sniff that checks for that issue, but it seems like something that should be in Squiz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions