class/Vote.php
Avoid using static access to class '\XoopsUser' in method 'getValuesVote'. Open
Open
$ret['uid'] = \XoopsUser::getUnameFromId($this->getVar('rate_uid'));
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 29 and the first side effect is on line 24. Open
Open
<?php declare(strict_types=1);
- Exclude checks