I am using PHP Mess Detector 1.5.0 and have a number of issues, that I do not believe are issues.
class FOO
{
const NEW_LINE = "\n";
const ADD = 1;
const DELETE = 2;
...
public function __construct($OptionOne = self::ADD)
{
}
}
In this code, I then use the constants similar to enumerations in C++ to work with options. Therefore, if I want to ADD something, I pass FOO::ADD in my code to the class, which is the same as 1.
I can test this class without an issue in PHPUnit, as I validate the constants, then I can pass the values and constants to functions.
I am not sure why PHPMD would complain about this, especially since it is a const value being referenced safely in PHP.