src/Statement/CommandList.php
Avoid using ECL\Statement\count() function in for loops. Open
Open
for($i = 0; $i < count($this->commands); ++$i) {
$command = $this->commands[$i];
$curr_result = $command->process($table);
$table[\ECL\SymbolTable::DEFAULT_SYMBOL] = $curr_result;
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
The variable $curr_result is not named in camelCase. Open
Open
public function process(\ECL\SymbolTable $table) {
$results = [];
// Loop over every Command and process it.
for($i = 0; $i < count($this->commands); ++$i) {
- 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 $curr_result is not named in camelCase. Open
Open
public function process(\ECL\SymbolTable $table) {
$results = [];
// Loop over every Command and process it.
for($i = 0; $i < count($this->commands); ++$i) {
- 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 $curr_result is not named in camelCase. Open
Open
public function process(\ECL\SymbolTable $table) {
$results = [];
// Loop over every Command and process it.
for($i = 0; $i < count($this->commands); ++$i) {
- 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();
}
}