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