Skip to content

Generic.NamingConventions.ConstructorName complains about old constructor in interfaces #2663

@mimmi20

Description

@mimmi20

In the Phing project there is this Interface

interface CustomChildCreator
{
    /**
     * Creates the object for the child element
     *
     * @param  string $elementName the name of the element that has been requested
     * @param  Project $project The project the element is in
     * @return object  Returns the nested element
     */
    public function customChildCreator($elementName, Project $project);
}

With the CodeSniffer I got this error:

FILE: ...cuments\GitHub\phing\classes\phing\parser\CustomChildCreator.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 36 | ERROR | PHP4 style constructors are not allowed; use
    |       | "__construct()" instead
    |       | (Generic.NamingConventions.ConstructorName.OldStyle)
----------------------------------------------------------------------

The Sniff should not compain this on Interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions