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

SocialAuthenticator::isSupported()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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