| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class CustomProviderConfigurator implements ProviderConfiguratorInterface |
||
| 10 | { |
||
| 11 | public function buildConfiguration(NodeBuilder $node) |
||
| 12 | { |
||
| 13 | // @formatter:off |
||
| 14 | $node |
||
| 15 | ->scalarNode('provider_class') |
||
| 16 | ->info('The class name of your provider class (e.g. the one that extends AbstractProvider)') |
||
| 17 | ->defaultValue(Custom::class) |
||
| 18 | ->end() |
||
| 19 | ->scalarNode('client_class') |
||
|
|
|||
| 20 | ->info('If you have a sub-class of OAuth2Client you want to use, add it here') |
||
| 21 | ->defaultValue(OAuth2Client::class) |
||
| 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 $config['provider_class']; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getProviderOptions(array $config) |
||
| 37 | { |
||
| 38 | return array_merge([ |
||
| 39 | 'client_id' => $config['client_id'], |
||
| 40 | 'client_secret' => $config['client_secret'], |
||
| 41 | ], $config['provider_options']); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getProviderDisplayName() |
||
| 47 | } |
||
| 48 | |||
| 49 | public function getClientClass(array $config) |
||
| 52 | } |
||
| 53 | } |
||
| 54 |