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

RedisManager::connector()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 9
ccs 0
cts 7
cp 0
crap 12
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
    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