Root/Map.php
Missing class import via use statement (line '78', column '20'). Open
Open
return new \ArrayIterator($this->items);
- 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 unused local variables such as '$item'. Open
Open
foreach ($this->items as $key => $item) {
- 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
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
Open
if ($key === $name) return TRUE;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
Open
return FALSE;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
Open
return NULL;
- Exclude checks
Inline control structures are not allowed Open
Open
foreach ($map as $key => $item) $this->add($key, $item);
- Exclude checks
Inline control structures are not allowed Open
Open
if ($key === $name) return $item;
- Exclude checks
Inline control structures are not allowed Open
Open
if ($key === $name) return TRUE;
- Exclude checks