brokencube/circuit

View on GitHub

Showing 67 of 67 total issues

Avoid unused local variables such as '$param'.
Open

        $param->args = $newparams;
Severity: Minor
Found in src/Middleware/ParameterMatcher.php by phpmd

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

Line exceeds 120 characters; contains 128 characters
Open

            $return = (new $params->className($params->container))->{$params->method}($request, ...array_values($params->args));
Severity: Minor
Found in src/HandlerContainer.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

        $params = new ControllerParams($uri, $this->controllerClass, $this->controllerMethod, $args, $router->getServiceContainer());
Severity: Minor
Found in src/HandlerContainer.php by phpcodesniffer

Line exceeds 120 characters; contains 160 characters
Open

            $this->log->error($e->getMessage(), ['trace' => $e->getTraceAsString(), 'line' => $e->getLine(), 'file' => $e->getFile(), 'code' => $e->getCode()]);

Whitespace found at end of line
Open

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

Whitespace found at end of line
Open

    public $className; 
Severity: Minor
Found in src/ControllerParams.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}

Possibly zero references to use statement for classlike/namespace Delegate (\Circuit\Interfaces\Delegate)
Open

use Circuit\Interfaces\Delegate;
Severity: Minor
Found in src/ControllerParams.php by phan

Possibly zero references to use statement for classlike/namespace ParameterDereferencer (\Circuit\Interfaces\ParameterDereferencer)
Open

use Circuit\Interfaces\ParameterDereferencer;
Severity: Minor
Found in src/Router.php by phan

Doc-block of $e in handleException contains phpdoc param type \Circuit\Throwable which is incompatible with the param type \Throwable declared in the signature
Open

     * @param Throwable $e The Exception / Error thrown.
Severity: Minor
Found in src/Router.php by phan

Possibly zero references to use statement for classlike/namespace Response (\Symfony\Component\HttpFoundation\Response)
Open

use Symfony\Component\HttpFoundation\Response;
Severity: Minor
Found in src/Exception/Exception.php by phan

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

            return new JsonResponse(

Doc-block of $middleware in __construct contains phpdoc param type \Circuit\Interfaces\Middleware which is incompatible with the param type array declared in the signature
Open

     * @param Middleware|string[]  $middleware     Array of middle ware to apply to all routes
Severity: Minor
Found in src/RouteCollector.php by phan

Possibly zero references to use statement for classlike/namespace JsonResponse (\Symfony\Component\HttpFoundation\JsonResponse)
Open

use Symfony\Component\HttpFoundation\JsonResponse;
Severity: Minor
Found in src/ControllerParams.php by phan

Doc-block of $stack in __construct contains phpdoc param type \Circuit\Interfaces\Middleware which is incompatible with the param type array declared in the signature
Open

     * @param Middleware|string[] $stack    A list of middleware (Middleware Objects or named Middleware) to be called
Severity: Minor
Found in src/HandlerContainer.php by phan

Argument 2 (args) is class-string but \Circuit\Router::log() takes mixed[] defined at /code/src/Router.php:309
Open

            $this->log("Router: Leaving Middleware: %s", get_class($next));
Severity: Minor
Found in src/Router.php by phan

Argument 2 (args) is string but \Circuit\Router::log() takes mixed[] defined at /code/src/Router.php:309
Open

            $this->log("Router: Leaving Middleware: %s", $next);
Severity: Minor
Found in src/Router.php by phan

Possibly zero references to use statement for classlike/namespace Middleware (\Circuit\Interfaces\Middleware)
Open

use Circuit\Interfaces\Middleware;
Severity: Minor
Found in src/ControllerParams.php by phan

Possibly zero references to use statement for classlike/namespace Request (\Symfony\Component\HttpFoundation\Request)
Open

use Symfony\Component\HttpFoundation\Request;
Severity: Minor
Found in src/ControllerParams.php by phan

Argument 2 (args) is float|int but \Circuit\Router::log() takes mixed[] defined at /code/src/Router.php:309
Open

        $this->log("Router: ->run() called. Starting clock at REQUEST_TIME+%.2fms", microtime(true) - $starttime);
Severity: Minor
Found in src/Router.php by phan
Severity
Category
Status
Source
Language