RouteProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 24
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A register() 0 4 2
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Service\Route;
6
7
8
use Laravel\Lumen\Application;
9
use Xervice\Service\Route\RouterCollection;
10
11
class RouteProvider implements RouteProviderInterface
12
{
13
    /**
14
     * @var \Xervice\Service\Route\RouterCollection
15
     */
16
    private $routeCollection;
17
18
    /**
19
     * RouteProvider constructor.
20
     *
21
     * @param \Xervice\Service\Route\RouterCollection $routeCollection
22
     */
23
    public function __construct(RouterCollection $routeCollection)
24
    {
25
        $this->routeCollection = $routeCollection;
26
    }
27
28
    /**
29
     * @param \Laravel\Lumen\Application $app
30
     */
31
    public function register(Application $app)
32
    {
33
        foreach ($this->routeCollection as $route) {
34
            $route->register($app->router);
35
        }
36
    }
37
38
}