Completed
Pull Request — master (#24)
by Matthew
03:43
created

RedisConfiguration::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 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
        $injector->prepare(Redis::class, function($redis) {
18
            $redis->connect(
19
                $this->env->getValue('REDIS_HOST', '127.0.0.1'),
20
                $this->env->getValue('REDIS_PORT', 6379)
21
            );
22
        });
23
    }
24
}
25