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

RoutesServiceProvider::routesAreCached()   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
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
crap 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