Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 3.1406 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function createPlugin(array $config = []): Plugin |
||
26 | { |
||
27 | if (! class_exists(CachePlugin::class)) { |
||
28 | 3 | throw new \LogicException('To use the logger plugin you need to install the "php-http/logger-plugin" package.'); |
|
29 | } |
||
30 | 3 | ||
31 | $formatter = $config['formatter'] ?? null; |
||
32 | |||
33 | return new LoggerPlugin( |
||
34 | 3 | $this->container->get($config['logger'] ?? LoggerInterface::class), |
|
35 | $formatter ? $this->container->get($formatter) : null |
||
36 | 3 | ); |
|
39 |