src/library/ThreemaGateway/Listener/FileHealthCheck.php
Missing class import via use statement (line '31', column '26'). Open
Open
$hashes[(new XenForo_Phrase('threemagw_integrity_of_addon_could_not_checked'))->render()] = '0';
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class 'ThreemaGateway_Listener_Data_FileSums' in method 'fileHealthCheck'. Open
Open
$hashes = array_merge($hashes, ThreemaGateway_Listener_Data_FileSums::getHashes());
- 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
Avoid unused parameters such as '$controller'. Open
Open
public static function fileHealthCheck(XenForo_ControllerAdmin_Abstract $controller, array &$hashes)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}