JsonApi/Request/PaginationParser.php
Avoid unused local variables such as '$value'. Open
Open
list($key, $value) = explode('=', $pair);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid using static access to class '\GoIntegro\Hateoas\Http\Url' in method 'parsePaginationlessUrl'. Open
Open
return Url::fromString($url);
- 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
There must be one USE keyword per declaration Open
Open
use Symfony\Component\HttpFoundation\Request,
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
Open
$callback = function($pair) {
- Exclude checks
Inline control structures are not allowed Open
Open
if (empty($params->primaryClass)) return $pagination;
- Exclude checks