Completed
Push — master ( 2384d0...cdc37f )
by Avtandil
03:50
created

RedisManager::connector()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3.0261

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 9
ccs 6
cts 7
cp 0.8571
crap 3.0261
rs 9.9666
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\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 3
    protected function connector()
24
    {
25 3
        switch ($this->driver) {
26 3
            case 'predis':
27 1
                return new \Illuminate\Redis\Connectors\PredisConnector();
28 2
            case 'phpredis':
29 2
                return new Connectors\PhpRedisConnector();
30
        }
31
    }
32
}
33