FML/Script/ScriptInclude.php
Avoid using static access to class 'FML\Script\Builder' in method '__toString'. Open
Open
return Builder::getInclude($this->file, $this->namespace);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The closing brace for the class must go on the next line after the body Open
Open
}
- Exclude checks
Class constants must be uppercase; expected MATHLIB but found MathLib Open
Open
const MathLib = "MathLib";
- Exclude checks
Class constants must be uppercase; expected TEXTLIB but found TextLib Open
Open
const TextLib = "TextLib";
- Exclude checks
Constant MathLib should be defined in uppercase Open
Open
const MathLib = "MathLib";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}
Source https://phpmd.org/rules/naming.html#constantnamingconventions
Constant TextLib should be defined in uppercase Open
Open
const TextLib = "TextLib";
- Read upRead up
- Exclude checks
ConstantNamingConventions
Since: 0.2
Class/Interface constant names should always be defined in uppercase.
Example
class Foo {
const MY_NUM = 0; // ok
const myTest = ""; // fail
}