ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 36
ccs 15
cts 15
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A boot() 0 21 2
1
<?php
2
3
namespace FMCSSOClient;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7
8
    /**
9
     * Register any application authentication / authorization services.
10
     *
11
     * @return void
12
     */
13 24
    public function boot()
14
    {
15 24
        if ($this->app->runningInConsole()) {
16 24
            $this->publishes([
17 24
                __DIR__ . '/../config/fmc-sso-client.php' => config_path('fmc-sso-client.php'),
18
            ], 'config');
19
20
21 24
            $this->commands([
22
                //
23
            ]);
24
        }
25
26 24
        $this->app->singleton(SSOClient::class, function () {
27 23
            return new SSOClient(
28 23
                config('services.fmc-sso.client_id', config('fmc-sso-client.client_id')),
29 23
                config('services.fmc-sso.client_secret', config('fmc-sso-client.client_secret')),
30 23
                config('services.fmc-sso.redirect_url', config('fmc-sso-client.redirect_url')),
31 23
                config('services.fmc-sso.scopes', config('fmc-sso-client.scopes')),
32 23
                config('services.fmc-sso.sso', config('fmc-sso-client.sso', [])),
33 23
                config('services.fmc-sso.guzzle', config('fmc-sso-client.guzzle', [])),
34
            );
35
        });
36
    }
37
38 24
    public function register()
39
    {
40 24
        $this->mergeConfigFrom(__DIR__ . '/../config/fmc-sso-client.php', 'fmc-sso-client');
41
    }
42
}
43