src/Process/Http/ResponseBodyEncoder.php
Method __invoke
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ServerRequestInterface $request,
ResponseInterface $response,
StreamFactoryInterface $streamFactory,
LoggerInterface $logger,
ObjectMapper $objectMapperJson,
Avoid unused local variables such as '$message'. Open
Open
$message = $t->getMessage();
- 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
Avoid unused parameters such as '$request'. Open
Open
ServerRequestInterface $request,
- 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 parameters such as '$logger'. Open
Open
LoggerInterface $logger,
- 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
syntax error, unexpected ':', expecting ',' or ')'
Open
Open
status: 500,
- Exclude checks
Avoid variables with short names like $t. Configured minimum length is 3. Open
Open
public function convertToSerializable(Throwable $t){
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Expected 1 blank line at end of file; 2 found Open
Open
}
- Exclude checks
The closing parenthesis of a multi-line function declaration must be on a new line Open
Open
UnitTrackerInterface $unitTracker)
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
Open
{
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($t instanceof \Pluf\Orm\Exception){
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
Open
} else if($t instanceof \atk4\core\Exception){
- Exclude checks
Opening brace should be on a new line Open
Open
public function convertToSerializable(Throwable $t){
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
Open
solutions: $solutions);
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
Open
solutions: $solutions);
- Exclude checks
Whitespace found at end of line Open
Open
ServerRequestInterface $request,
- Exclude checks
Whitespace found at end of line Open
Open
StreamFactoryInterface $streamFactory,
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if($t instanceof \Pluf\Orm\Exception){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
} else if($t instanceof \atk4\core\Exception){
- Exclude checks
Whitespace found at end of line Open
Open
ResponseInterface $response,
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
} else if($t instanceof \atk4\core\Exception){
- Exclude checks