Passed
Pull Request — master (#108)
by
unknown
05:52
created

ServiceProvider::loadMigrations()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 3
Bugs 0 Features 1
Metric Value
cc 2
eloc 2
c 3
b 0
f 1
nc 2
nop 0
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 6
rs 10
1
<?php
2
3
namespace Slides\Saml2;
4
5
/**
6
 * Class ServiceProvider
7
 *
8
 * @package Slides\Saml2
9
 */
10
class ServiceProvider extends \Illuminate\Support\ServiceProvider
11
{
12
    /**
13
     * Indicates if loading of the provider is deferred.
14
     *
15
     * @var bool
16
     */
17
    protected $defer = false;
18
19
    /**
20
     * Bootstrap the application events.
21
     *
22
     * @return void
23
     */
24
    public function boot()
25
    {
26
        $this->bootMiddleware();
27
        $this->bootRoutes();
28
        $this->bootPublishes();
29
    }
30
31
    /**
32
     * Bootstrap the routes.
33
     *
34
     * @return void
35
     */
36
    protected function bootRoutes()
37
    {
38
        if($this->app['config']['saml2.useRoutes'] == true) {
39
            include __DIR__ . '/Http/routes.php';
40
        }
41
    }
42
43
    /**
44
     * Bootstrap the publishable files.
45
     *
46
     * @return void
47
     */
48
    protected function bootPublishes()
49
    {
50
        $source = __DIR__ . '/../config/saml2.php';
51
52
        $this->publishes([$source => config_path('saml2.php')]);
53
        $this->mergeConfigFrom($source, 'saml2');
54
    }
55
56
    /**
57
     * Bootstrap the console commands.
58
     *
59
     * @return void
60
     */
61
    protected function bootMiddleware()
62
    {
63
        $this->app['router']->aliasMiddleware('saml2.resolveIdp', \Slides\Saml2\Http\Middleware\ResolveIdp::class);
64
    }
65
}
66