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

Skip check for ConstructorWithNameAsEnclosingClass when in an interface or namespace #220

Closed
gooh opened this issue Oct 31, 2014 · 0 comments

Comments

@gooh
Copy link
Contributor

gooh commented Oct 31, 2014

PHPMD will report a violation when it finds a file like this:

namespace ACME\Foo;

interface ExtendTokenLifetime
{
    public function extendTokenLifetime($tokenString);
}

While it's easy to work around this by making the interface name a noun like TokenLifetimeExtender it feels odd having to do so when it's an interface. Interfaces should not contain constructors anyway, so assuming I defined one here feels like a bug to me. In addition, there is namespace here so the method would never not get treated as a ctor anyway.

Relates to #31

manuelpichler added a commit that referenced this issue Nov 10, 2014
Closes #220: ignore php4 style ctor in interfaces and namespaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants