alexpts/php-psr15-routing

View on GitHub

Showing 6 of 6 total issues

Missing class import via use statement (line '106', column '23').
Open

            throw new \BadMethodCallException('Action not found');
Severity: Minor
Found in src/PTS/EndPoint/EndPoint.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '18', column '23').
Open

            throw new \BadMethodCallException('Not found controller name for dynamic controller point');
Severity: Minor
Found in src/PTS/EndPoint/DynamicPoint.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method getRoutes has a boolean flag argument $sortByPriority, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getRoutes(bool $sortByPriority = true): array
Severity: Minor
Found in src/PTS/PSR15Routing/Router.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

Missing class import via use statement (line '93', column '23').
Open

            throw new \BadMethodCallException('Controller not found');
Severity: Minor
Found in src/PTS/EndPoint/EndPoint.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid unused parameters such as '$request'.
Open

    protected function getControllerClass(ServerRequestInterface $request): string
Severity: Minor
Found in src/PTS/EndPoint/EndPoint.php by phpmd

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 '$handler'.
Open

    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface

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

Severity
Category
Status
Source
Language