SocialiteServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
}