Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function createPlugin(array $config = []): Plugin |
||
30 | { |
||
31 | 1 | $options = $config['options'] ?? []; |
|
32 | $type = $config['type'] ?? null; |
||
33 | 1 | ||
34 | 1 | $authFactory = $this->factories[$type] ?? null; |
|
35 | |||
36 | if (! $authFactory instanceof Authentication\AuthenticationFactory) { |
||
37 | 1 | throw new InvalidArgumentException('Unsupported authentication type'); |
|
38 | } |
||
39 | 1 | ||
40 | return new AuthenticationPlugin($authFactory->createAuthentication($options)); |
||
41 | } |
||
43 |