PredisConfiguration::getOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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