SocialiteServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 42
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 2
A loadRegister() 0 6 1
A provides() 0 4 1
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Laravel\Socialite\SocialiteManager;
7
use Laravel\Socialite\SocialiteServiceProvider as BaseSocialiteServiceProvider;
8
9
class SocialiteServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = true;
17
18
    /**
19
     * Provider register.
20
     *
21
     * @return void
22
     */
23
    public function register()
24
    {
25
        if (class_exists(BaseSocialiteServiceProvider::class))
26
            $this->loadRegister();
27
    }
28
29
    /**
30
     * Load register.
31
     *
32
     * @return void
33
     */
34
    public function loadRegister()
35
    {
36
        $this->app->singleton('Laravel\Socialite\Contracts\Factory', function ($app) {
37
            return new SocialiteManager($app);
38
        });
39
    }
40
41
    /**
42
     * Get the services provided by the provider.
43
     *
44
     * @return array
45
     */
46
    public function provides()
47
    {
48
        return ['Laravel\Socialite\Contracts\Factory'];
49
    }
50
}