GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 216ab3...9dc691 )
by Benjamin
03:20
created

RouteCollection   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 7
cts 9
cp 0.7778
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 3 1
A get() 0 3 2
A all() 0 3 1
A count() 0 3 1
1
<?php
2
3
namespace App\Lib\Routing;
4
5
class RouteCollection
6
{
7
    protected $routes = [];
8
9 6
    public function add(string $name, RouteDefinition $route)
10
    {
11 6
        $this->routes[$name] = $route;
12 6
    }
13
14
    public function get($name)
15
    {
16
        return isset($this->routes[$name]) ? $this->routes[$name] : false;
17
    }
18
19 4
    public function all()
20
    {
21 4
        return $this->routes;
22
    }
23
24 2
    public function count()
25
    {
26 2
        return count($this->routes);
27
    }
28
}
29