RouteProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
}