Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mimmi20 opened this issue Oct 22, 2019 · 1 comment

Comments

@mimmi20
Copy link

mimmi20 commented Oct 22, 2019

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.

@gsherwood gsherwood changed the title "Generic.NamingConventions.ConstructorName.OldStyle" complains old contructor in interface Generic.NamingConventions.ConstructorName complains about old constructor in interfaces Oct 24, 2019
@gsherwood gsherwood added this to Idea Bank in PHPCS v3 Development via automation Oct 24, 2019
@gsherwood gsherwood added this to the 3.5.2 milestone Oct 24, 2019
gsherwood added a commit that referenced this issue Oct 24, 2019
@gsherwood
Copy link
Member

Thanks for reporting this. The fix will be in 3.5.2

PHPCS v3 Development automation moved this from Idea Bank to Ready for Release Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
PHPCS v3 Development
Ready for Release
Development

No branches or pull requests

2 participants