Passed
Push — master ( fdd409...5e2aee )
by Yaroslav
02:55
created

ServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 12
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 20
ccs 14
cts 14
cp 1
crap 2
rs 9.8666
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 21
    public function boot()
14
    {
15 21
        if ($this->app->runningInConsole()) {
16 21
            $this->publishes([
17 21
                __DIR__ . '/../config/fmc-sso-client.php' => config_path('fmc-sso-client.php'),
18 21
            ], 'config');
19
20
21 21
            $this->commands([
22
                //
23 21
            ]);
24
        }
25
26 21
        $this->app->singleton(SSOClient::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
        $this->app->singleton(SSOClient::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27 20
            return new SSOClient(
28 20
                config('services.fmc-sso.client_id', config('fmc-sso-client.client_id')),
29 20
                config('services.fmc-sso.client_secret', config('fmc-sso-client.client_secret')),
30 20
                config('services.fmc-sso.redirect_url', config('fmc-sso-client.redirect_url')),
31 20
                config('services.fmc-sso.sso', config('fmc-sso-client.sso', [])),
32 20
                config('services.fmc-sso.guzzle', config('fmc-sso-client.guzzle', [])),
33
            );
34 21
        });
35 21
    }
36
37 21
    public function register()
38
    {
39 21
        $this->mergeConfigFrom(__DIR__ . '/../config/fmc-sso-client.php', 'fmc-sso-client');
40 21
    }
41
}
42