Completed
Push — master ( 946ee3...527704 )
by Avtandil
09:45
created

RedisManager::connector()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3.2098

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 9
ccs 5
cts 7
cp 0.7143
crap 3.2098
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Longman\LaravelLodash\Redis;
6
7
use Illuminate\Redis\Connectors\PredisConnector;
8
use Illuminate\Redis\RedisManager as BaseRedisManager;
9
10
class RedisManager extends BaseRedisManager
11
{
12
    /**
13
     * Get the connector instance for the current driver.
14
     *
15
     * @return \Longman\LaravelLodash\Redis\Connectors\PhpRedisConnector|\Illuminate\Redis\Connectors\PredisConnector
16
     */
17 2
    protected function connector()
18
    {
19 2
        switch ($this->driver) {
20 2
            case 'predis':
21
                return new PredisConnector();
0 ignored issues
show
Deprecated Code introduced by
The class Illuminate\Redis\Connectors\PredisConnector has been deprecated with message: Predis is no longer maintained by its original author

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
22 2
            case 'phpredis':
23 2
                return new Connectors\PhpRedisConnector();
24
        }
25
    }
26
}
27