PredisConfiguration   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 23
ccs 14
cts 14
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getOptions() 0 3 1
A __construct() 0 7 1
A getConnectionParams() 0 6 1
1
<?php
2
/*
3
 * This file is part of the Koded package.
4
 *
5
 * (c) Mihail Binev <[email protected]>
6
 *
7
 * Please view the LICENSE distributed with this source code
8
 * for the full copyright and license information.
9
 */
10
11
namespace Koded\Caching\Configuration;
12
13
use Koded\Stdlib\Serializer;
14
15
final class PredisConfiguration extends CacheConfiguration
16
{
17 135
    public function __construct(array $values)
18
    {
19 135
        $values += [
20 135
            'serializer' => Serializer::PHP,
21 135
            'binary' => Serializer::PHP,
22 135
        ];
23 135
        parent::__construct($values);
24
    }
25
26 135
    public function getConnectionParams(): array
27
    {
28 135
        return [
29 135
            'scheme' => $this->get('scheme', 'tcp'),
30 135
            'host' => $this->get('host', '127.0.0.1'),
31 135
            'port' => $this->get('port', 6379)
32 135
        ];
33
    }
34
35 135
    public function getOptions(): ?array
36
    {
37 135
        return $this->get('options');
38
    }
39
}
40