Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
13 | 1 | public function __invoke(array $options) |
|
14 | { |
||
15 | 1 | $host = (string) ($options['host'] ?? 'localhost'); |
|
16 | 1 | $port = (int) ($options['port'] ?? 5984); |
|
17 | 1 | $dbname = (string) ($options['port'] ?? 'logger'); |
|
18 | 1 | $userName = (string) ($options['username'] ?? ''); |
|
19 | 1 | $password = (string) ($options['password'] ?? ''); |
|
20 | 1 | $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
21 | 1 | $bubble = (bool) ($options['bubble'] ?? true); |
|
22 | |||
23 | 1 | return new CouchDBHandler( |
|
24 | [ |
||
25 | 1 | 'host' => $host, |
|
26 | 1 | 'port' => $port, |
|
27 | 1 | 'dbname' => $dbname, |
|
28 | 1 | 'username' => $userName, |
|
29 | 1 | 'password' => $password |
|
30 | ], |
||
31 | 1 | $level, |
|
32 | 1 | $bubble |
|
33 | ); |
||
34 | } |
||
35 | } |
||
36 |