brokencube/circuit

View on GitHub
src/ExceptionHandler/DefaultHandler.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using undefined variables such as '$statusTexts' which will lead to PHP notices.
Open

                ['error' => $e->getStatusCode() . ' ' . Response::$statusTexts[$e->getStatusCode()] ],

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$statusTexts' which will lead to PHP notices.
Open

            $e->getStatusCode() . ' ' . Response::$statusTexts[$e->getStatusCode()],

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Returning type \Circuit\ExceptionHandler\JsonResponse but handle() is declared to return \Symfony\Component\HttpFoundation\Response
Open

            return new JsonResponse(

Avoid variables with short names like $e. Configured minimum length is 3.
Open

    public function handle(Exception $e, Request $request) : Response

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

There are no issues that match your filters.

Category
Status