Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.7085 |
Changes | 0 |
1 | <?php |
||
31 | 31 | public static function createPluginProvider(array $plugins, $factory, array $config, array $pluginProviderOptions = []): PluginProvider |
|
32 | { |
||
33 | 31 | if ($factory instanceof ProviderFactoryInterface) { |
|
34 | 31 | $client = $factory->createProvider($config); |
|
35 | } elseif (is_callable($factory)) { |
||
36 | $client = $factory($config); |
||
37 | } else { |
||
38 | throw new \RuntimeException(sprintf('Second argument to PluginProviderFactory::createPluginProvider must be a "%s" or a callable.', ProviderFactoryInterface::class)); |
||
39 | } |
||
40 | |||
41 | 31 | return new PluginProvider($client, $plugins, $pluginProviderOptions); |
|
42 | } |
||
43 | } |
||
44 |