Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.4746 |
Changes | 0 |
1 | <?php |
||
23 | 4 | public static function createPluginClient(array $plugins, $factory, array $config, array $pluginClientOptions = []) |
|
24 | { |
||
25 | 4 | if ($factory instanceof ClientFactory) { |
|
26 | 4 | $client = $factory->createClient($config); |
|
27 | 4 | } elseif (is_callable($factory)) { |
|
28 | $client = $factory($config); |
||
29 | } else { |
||
30 | throw new \RuntimeException(sprintf('Second argument to PluginClientFactory::createPluginClient must be a "%s" or a callable.', ClientFactory::class)); |
||
31 | } |
||
32 | |||
33 | 4 | return new PluginClient($client, $plugins, $pluginClientOptions); |
|
34 | } |
||
35 | } |
||
36 |