core/Backend/Renderer/LayoutAreaRenderer.php
Avoid unused parameters such as '$data'. Open
Open
public function slotData($data = [])
- 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
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid using short method names like LayoutAreaRenderer::el(). The configured minimum method name length is 3. Open
Open
public function el($attr)
{
$attr = esc_attr($attr);
return "data-kba-el='{$attr}'";
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}