Completed
Push — master ( eed8e4...38e21d )
by ARCANEDEV
9s
created

SocialAuthenticator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 36
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isEnabled() 0 4 1
A drivers() 0 6 1
A isSupported() 0 4 1
1
<?php namespace Arcanedev\LaravelAuth\Services;
2
3
/**
4
 * Class     SocialAuthenticator
5
 *
6
 * @package  Arcanedev\LaravelAuth\Services
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class SocialAuthenticator
10
{
11
    /**
12
     * Check if social authentication is enabled.
13
     *
14
     * @return bool
15
     */
16 657
    public static function isEnabled()
17
    {
18 657
        return config('laravel-auth.socialite.enabled', false);
19
    }
20
21
    /**
22
     * Get the supported drivers.
23
     *
24
     * @return array
25
     */
26 18
    public static function drivers()
27
    {
28 18
        $drivers = array_filter(config('laravel-auth.socialite.drivers', []));
29
30 18
        return array_keys($drivers);
31
    }
32
33
    /**
34
     * Check if the given driver is supported.
35
     *
36
     * @param  string  $driver
37
     *
38
     * @return bool
39
     */
40 9
    public static function isSupported($driver)
41
    {
42 9
        return in_array($driver, static::drivers());
43
    }
44
}
45