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

Invalid CamelCaseVariableName violation on prefixed properties #261

Closed
ravage84 opened this Issue Feb 4, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@ravage84
Member

ravage84 commented Feb 4, 2015

It seems that the CamelCaseVariableName rule reports static acess to underscore prefixed properties as violation in PHPMD 2.2.0.

The variable $_colorArray is not named in camelCase.

if (!in_array($colorName, self::$_colorArray)) {

This should not be reported as violation against the CamelCaseVariableName rule but rather against the CamelCasePropertyName rule.

@manuelpichler

This comment has been minimized.

Member

manuelpichler commented Mar 16, 2015

Does this issue still exist? Just tested it with the following code:

<?php
class MyClass{
    function myFunction() {
        if (!in_array($colorName, self::$_colorArray)) { }
    }
}

and got no error

@ravage84 ravage84 self-assigned this Mar 16, 2015

@ravage84 ravage84 added the Bug label Mar 16, 2015

ravage84 added a commit to ravage84/phpmd that referenced this issue Mar 22, 2015

@ravage84

This comment has been minimized.

Member

ravage84 commented Mar 22, 2015

@manuelpichler have a look at #277

@steverobbins

This comment has been minimized.

steverobbins commented Jul 2, 2015

Having the same issue. Is this going to get merged in?

@ravage84 ravage84 modified the milestone: 2.3.3 Nov 7, 2015

@ravage84 ravage84 modified the milestones: 2.3.3, 2.4.2 Mar 8, 2016

manuelpichler added a commit that referenced this issue Mar 10, 2016

@manuelpichler

This comment has been minimized.

Member

manuelpichler commented Mar 10, 2016

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment