SsoServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 3
b 0
f 0
nc 1
nop 0
dl 0
loc 11
ccs 6
cts 6
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Spinen\Discourse;
4
5
use Illuminate\Contracts\Routing\Registrar as Router;
6
use Illuminate\Support\ServiceProvider;
7
8
/**
9
 * Class SsoServiceProvider
10
 *
11
 * @package Spinen\Discourse
12
 */
13
class SsoServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * Perform post-registration booting of services.
17
     *
18
     * @return void
19
     */
20 1
    public function boot()
21
    {
22 1
        $this->app['router']->group(
23 1
            ['middleware' => $this->app['config']->get('services.discourse.middleware', ['web', 'auth'])],
24
            function (Router $router) {
25 1
                $router->get(
26 1
                    $this->app['config']->get('services.discourse.route'),
27
                    [
28 1
                        'as'   => 'sso.login',
29
                        'domain' => $this->app['config']->get('services.discourse.domain', null),
30
                        'uses' => 'Spinen\Discourse\Controllers\SsoController@login',
31
                    ]
32 1
                );
33
            }
34 1
        );
35
    }
36
}
37