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