Passed
Push — master ( bdf088...707f4a )
by Eric
01:58
created

Provider::createProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Application: directus_keycloak_client
4
 * Author: Eric Delaporte <[email protected]>
5
 * Date: 19.11.19
6
 * Time: 23:59
7
 */
8
namespace Makuro\Directus\KeycloakClient;
9
10
use Directus\Authentication\Sso\TwoSocialProvider;
0 ignored issues
show
Bug introduced by
The type Directus\Authentication\Sso\TwoSocialProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use League\OAuth2\Client\Provider\AbstractProvider;
12
use Makuro\Directus\KeycloakClient\Provider\Keycloak;
13
14
class Provider extends TwoSocialProvider
15
{
16
    /**
17
     * @var Keycloak
18
     */
19
    protected $provider = null;
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function getScopes()
25
    {
26
        return [
27
            'email'
28
        ];
29
    }
30
31
    /**
32
     * Creates the Google provider oAuth client
33
     *
34
     * @return AbstractProvider
35
     */
36
    protected function createProvider()
37
    {
38
        $this->provider = new Keycloak([
39
            'authServerUrl'         => $this->config->get('authServerUrl'),
40
            'realm'                 => $this->config->get('realm'),
41
            'clientId'              => $this->config->get('clientId'),
42
            'clientSecret'          => $this->config->get('clientSecret'),
43
            'redirectUri'           => $this->getRedirectUrl()
44
        ]);
45
46
        return $this->provider;
47
    }
48
49
50
}