Completed
Pull Request — master (#4)
by Neo
02:47
created

RedisManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A connector() 0 9 3
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\Redis;
13
14
use Illuminate\Redis\RedisManager as BaseRedisManager;
15
16
class RedisManager extends BaseRedisManager
17
{
18
    /**
19
     * Get the connector instance for the current driver.
20
     *
21
     * @return \Longman\LaravelLodash\Redis\Connectors\PhpRedisConnector|\Illuminate\Redis\Connectors\PredisConnector
22
     */
23
    protected function connector()
24
    {
25
        switch ($this->driver) {
26
            case 'predis':
27
                return new \Illuminate\Redis\Connectors\PredisConnector();
28
            case 'phpredis':
29
                return new Connectors\PhpRedisConnector();
30
        }
31
    }
32
}
33