F9/Console/Commands/ClearCacheCommand.php
Avoid unused parameters such as '$input'. Open
Open
protected function execute(InputInterface $input, OutputInterface $output)
- 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 unused local variables such as '$response'. Open
Open
$response = shell_exec('rm -Rf ' . CACHE . 'blade/* 2>&1 1> /dev/null');
- 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
The variable $header_style is not named in camelCase. Open
Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$header_style = new OutputFormatterStyle('white', 'default', ['bold']);
$output->getFormatter()->setStyle('header', $header_style);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $header_style is not named in camelCase. Open
Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$header_style = new OutputFormatterStyle('white', 'default', ['bold']);
$output->getFormatter()->setStyle('header', $header_style);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}