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