Completed
Branch master (df0330)
by Gabriel
08:50 queued 06:43
created

RoutesServiceProvider   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 46
rs 10
c 0
b 0
f 0
ccs 0
cts 11
cp 0
wmc 6
lcom 1
cbo 2

5 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A boot() 0 10 2
A loadRoutes() 0 3 1
A routesAreCached() 0 4 1
A provides() 0 4 1
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