Completed
Push — master ( 021295...2ba284 )
by Westin
05:24
created

DoctrineCouchDBHandlerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 8
cts 8
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace WShafer\PSR11MonoLog\Handler;
5
6
use Monolog\Handler\DoctrineCouchDBHandler;
7
use Monolog\Logger;
8
use WShafer\PSR11MonoLog\ClientTrait;
9
use WShafer\PSR11MonoLog\ContainerAwareInterface;
10
use WShafer\PSR11MonoLog\FactoryInterface;
11
12
class DoctrineCouchDBHandlerFactory implements FactoryInterface, ContainerAwareInterface
13
{
14
    use ClientTrait;
15
16 1
    public function __invoke(array $options)
17
    {
18 1
        $client  = $this->getClient($options);
19 1
        $level   = (int)     ($options['level']   ?? Logger::DEBUG);
20 1
        $bubble  = (boolean) ($options['bubble']  ?? true);
21
22 1
        return new DoctrineCouchDBHandler(
23 1
            $client,
24 1
            $level,
25 1
            $bubble
26
        );
27
    }
28
}
29