Total Complexity | 5 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class DraugiemProviderConfigurator implements ProviderConfiguratorInterface |
||
10 | { |
||
11 | public function buildConfiguration(NodeBuilder $node) |
||
12 | { |
||
13 | // @formatter:off |
||
14 | $node |
||
15 | ->scalarNode('client_class') |
||
16 | ->info('If you have a sub-class of OAuth2Client you want to use, add it here') |
||
17 | ->defaultValue(DraugiemOAuth2Client::class) |
||
18 | ->end() |
||
19 | ->scalarNode('redirect_route') |
||
|
|||
20 | ->isRequired() |
||
21 | ->cannotBeEmpty() |
||
22 | ->end() |
||
23 | ->arrayNode('provider_options') |
||
24 | ->info('Other options to pass to your provider\'s constructor') |
||
25 | ->prototype('variable')->end() |
||
26 | ->end() |
||
27 | ; |
||
28 | // @formatter:on |
||
29 | } |
||
30 | |||
31 | public function getProviderClass(array $config) |
||
32 | { |
||
33 | return Draugiem::class; |
||
34 | } |
||
35 | |||
36 | public function getProviderOptions(array $config) |
||
37 | { |
||
38 | return array_merge([ |
||
39 | 'clientId' => $config['client_id'], |
||
40 | 'clientSecret' => $config['client_secret'], |
||
41 | 'redirect_route' => $config['redirect_route'], |
||
42 | ], $config['provider_options']); |
||
43 | } |
||
44 | |||
45 | public function getProviderDisplayName() |
||
46 | { |
||
47 | return 'Draugiem.lv'; |
||
48 | } |
||
49 | |||
50 | public function getClientClass(array $config) |
||
53 | } |
||
54 | } |
||
55 |