Completed
Push — master ( d0c6f2...e28c79 )
by Avtandil
03:11
created

CacheManager::createRedisDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
ccs 0
cts 6
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Laravel Lodash package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
declare(strict_types=1);
11
12
namespace Longman\LaravelLodash\Cache;
13
14
use Illuminate\Cache\CacheManager as BaseCacheManager;
15
16
class CacheManager extends BaseCacheManager
17
{
18
    /**
19
     * Create an instance of the Redis cache driver.
20
     *
21
     * @param  array  $config
22
     * @return \Longman\LaravelLodash\Cache\RedisStore
23
     */
24
    protected function createRedisDriver(array $config)
25
    {
26
        $redis = $this->app['redis'];
27
28
        $connection = $config['connection'] ?? 'default';
29
30
        return $this->repository(new RedisStore($redis, $this->getPrefix($config), $connection));
31
    }
32
}
33