Completed
Push — master ( df0330...a615ca )
by Gabriel
06:40 queued 02:30
created

RouterServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Nip\Router;
4
5
use Nip\Container\ServiceProviders\Providers\AbstractSignatureServiceProvider;
6
use Nip\Router\Console\CacheCommand;
7
use Nip\Router\Console\ClearCommand;
8
9
/**
10
 * Class RouterServiceProvider
11
 * @package Nip\Router
12
 */
13
class RouterServiceProvider extends AbstractSignatureServiceProvider
14
{
15
    use ServiceProvider\Traits\LoaderTrait;
16
    use ServiceProvider\Traits\RouterTrait;
17
    use ServiceProvider\Traits\RoutesTrait;
18
    use ServiceProvider\Traits\UrlGeneratorTrait;
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function provides()
24
    {
25
        return ['router', 'routing.loader', 'routes', 'url'];
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31 3
    public function register()
32
    {
33 3
        $this->registerLoader();
34 3
        $this->registerRouter();
35 3
        $this->registerRoutes();
36 3
        $this->registerUrlGenerator();
37 3
    }
38
39
    protected function registerCommands()
40
    {
41
        $this->commands(
42
            CacheCommand::class,
43
            ClearCommand::class
44
        );
45
    }
46
}
47