M
M
matperez2015-05-19 13:37:48
PHP
matperez, 2015-05-19 13:37:48

Why doesn't phpmd's own ruleset apply in phpstorm?

Hello!
I need to be able to name private variables with an underscore at the beginning. I understand that the "CamelCasePropertyName" rule and its "allow-underscore" parameter are suitable for this.
Added rule to ruleset:

<rule ref="rulesets/controversial.xml/CamelCasePropertyName">
        <priority>1</priority>
        <properties>
            <property name="allow-underscore" value="true" />
        </properties>
    </rule>

Added it to PHPStorm in PHP Mess Detector valdidation. But variables with an underscore at the beginning are still underlined as errors.
Tell me what else can be checked, where to fix it?
//upd
I noticed that if I just run it with my own ruleset, then there are no errors.
phpmd ./components/View.php text ./build/phpmd.xml
If I add the controversial ruleset, I get an error
phpmd ./components/View.php text ./build/phpmd.xml,controversial
View.php:17    The property $_pageCategory is not named in camelCase.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question