RoutesServiceProvider   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 44
rs 10
c 1
b 0
f 0
ccs 0
cts 13
cp 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A loadRoutes() 0 2 1
A routesAreCached() 0 3 1
A provides() 0 3 1
A register() 0 2 1
A boot() 0 9 2
1
<?php
2
3
namespace Nip\Router;
4
5
use Nip\Container\ServiceProviders\Providers\AbstractSignatureServiceProvider;
6
use Nip\Container\ServiceProviders\Providers\BootableServiceProviderInterface;
7
8
/**
9
 * Class MailServiceProvider
10
 * @package Nip\Mail
11
 */
12
class RoutesServiceProvider extends AbstractSignatureServiceProvider implements BootableServiceProviderInterface
13
{
14
15
    /**
16
     * @inheritdoc
17
     */
18
    public function register()
19
    {
20
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function boot()
26
    {
27
        if ($this->routesAreCached()) {
28
            // Call get matcher to load the routes
29
//            $this->getContainer()->get('router')->getMatcher();
30
            return;
31
        }
32
33
        $this->loadRoutes();
34
    }
35
36
    public function loadRoutes()
37
    {
38
    }
39
40
    /**
41
     * Determine if the application routes are cached.
42
     *
43
     * @return bool
44
     */
45
    protected function routesAreCached()
46
    {
47
        return $this->getContainer()->get('app')->routesAreCached();
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function provides()
54
    {
55
        return [];
56
    }
57
}
58