RedisConfiguration::apply()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Equip\Configuration;
4
5
use Auryn\Injector;
6
use Redis;
7
8
class RedisConfiguration implements ConfigurationInterface
9
{
10
    use EnvTrait;
11
12
    /**
13
     * @inheritDoc
14
     */
15
    public function apply(Injector $injector)
16
    {
17 1
        $injector->prepare(Redis::class, function($redis) {
18 1
            $redis->connect(
19 1
                $this->env->getValue('REDIS_HOST', '127.0.0.1'),
20 1
                $this->env->getValue('REDIS_PORT', 6379)
21 1
            );
22 1
        });
23 1
    }
24
}
25