src/Flow/Loop.php

Summary

Maintainability
A
0 mins
Test Coverage

Remove the unused function parameter "$value".
Open

    public function __set(string $name, $value)
Severity: Major
Found in src/Flow/Loop.php by sonar-php

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

The closing brace for the class must go on the next line after the body
Open

}
Severity: Minor
Found in src/Flow/Loop.php by phpcodesniffer

Expected 1 space after closing parenthesis; found 9
Open

        if (!empty($data))
Severity: Minor
Found in src/Flow/Loop.php by phpcodesniffer

There are no issues that match your filters.

Category
Status