Total Complexity | 2 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | class CompositeRouter extends Router |
||
15 | { |
||
16 | /** |
||
17 | * Namespace applied to all class-based routes. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $namespace = 'App\Zapheus'; |
||
22 | |||
23 | /** |
||
24 | * Merges the new route instances. |
||
25 | * |
||
26 | * @param \Zapheus\Routing\RouterInterface $router |
||
27 | * @return self |
||
28 | */ |
||
29 | 9 | public function merge(RouterInterface $router) |
|
30 | { |
||
31 | 9 | $routes = $router->routes(); |
|
32 | |||
33 | 9 | $this->routes = array_merge($this->routes, $routes); |
|
34 | |||
35 | 9 | return $this; |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * Returns an array of route instances. |
||
40 | * |
||
41 | * @return \Zapheus\Routing\Route[] |
||
42 | */ |
||
43 | 9 | public function routes() |
|
52 | } |
||
53 | } |
||
54 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.