Skip to content

InstantiateNewClassesSniff can be simplified #103

Open
@aik099

Description

@aik099

The https://github.com/joomla/coding-standards/blob/master/Sniffs/Classes/InstantiateNewClassesSniff.php sniff is doing a lot of comparisons inside, but if it really checks that no () are present after new SomeClass then why it's not checking that.

  1. find class name, that is created (including namespace)
  2. get next non-whitespace char and if it's not ( then return
  3. get next non-whitespace char and if it's not ) then report an error and return in other case

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions