Completed
Push — dev-master ( c74067...0fa404 )
by Derek Stephen
01:32
created

Router   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 22
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRoutes() 0 4 1
A removeRoute() 0 8 3
1
<?php
2
3
namespace Bone\Mvc;
4
5
use League\Route\Router as LeagueRouter;
6
7
class Router extends LeagueRouter
8
{
9
    /**
10
     * @return Route[]
11
     */
12
    public function getRoutes(): array
13
    {
14
        return $this->routes;
15
    }
16
17
    /**
18
     * @param Route $route
0 ignored issues
show
Bug introduced by
There is no parameter named $route. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
19
     */
20
    public function removeRoute(Route $routeToRemove): void
21
    {
22
        foreach ($this->routes as $index => $route) {
23
            if ($route === $routeToRemove) {
24
                unset($this->routes[$index]);
25
            }
26
        }
27
    }
28
}