1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Created by PhpStorm. |
4
|
|
|
* User: Geolim4 |
5
|
|
|
* Date: 12/02/2018 |
6
|
|
|
* Time: 23:10 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Phpfastcache\Drivers\Predis; |
10
|
|
|
|
11
|
|
|
use Phpfastcache\Config\ConfigurationOption; |
12
|
|
|
|
13
|
|
|
class Config extends ConfigurationOption |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var string |
17
|
|
|
*/ |
18
|
|
|
protected $host = '127.0.0.1'; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var int |
22
|
|
|
*/ |
23
|
|
|
protected $port = 6379; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
protected $password = ''; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var int |
32
|
|
|
*/ |
33
|
|
|
protected $database = 0; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var \Predis\Client |
|
|
|
|
37
|
|
|
*/ |
38
|
|
|
protected $predisClient; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @return string |
42
|
|
|
*/ |
43
|
|
|
public function getHost(): string |
44
|
|
|
{ |
45
|
|
|
return $this->host; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @param string $host |
50
|
|
|
* @return Config |
51
|
|
|
*/ |
52
|
|
|
public function setHost(string $host): self |
53
|
|
|
{ |
54
|
|
|
$this->host = $host; |
55
|
|
|
return $this; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return int |
60
|
|
|
*/ |
61
|
|
|
public function getPort(): int |
62
|
|
|
{ |
63
|
|
|
return $this->port; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @param int $port |
68
|
|
|
* @return Config |
69
|
|
|
*/ |
70
|
|
|
public function setPort(int $port): self |
71
|
|
|
{ |
72
|
|
|
$this->port = $port; |
73
|
|
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return null |
78
|
|
|
*/ |
79
|
|
|
public function getPassword() |
80
|
|
|
{ |
81
|
|
|
return $this->password; |
|
|
|
|
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param null $password |
|
|
|
|
86
|
|
|
* @return self |
87
|
|
|
*/ |
88
|
|
|
public function setPassword(string $password): self |
89
|
|
|
{ |
90
|
|
|
$this->password = $password; |
91
|
|
|
return $this; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return int |
96
|
|
|
*/ |
97
|
|
|
public function getDatabase(): int |
98
|
|
|
{ |
99
|
|
|
return $this->database; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param int $database |
104
|
|
|
* @return Config |
105
|
|
|
*/ |
106
|
|
|
public function setDatabase(int $database): self |
107
|
|
|
{ |
108
|
|
|
$this->database = $database; |
109
|
|
|
return $this; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @return array |
114
|
|
|
*/ |
115
|
|
|
public function getPredisConfigArray(): array |
116
|
|
|
{ |
117
|
|
|
return [ |
118
|
|
|
'host' => $this->getHost(), |
119
|
|
|
'port' => $this->getPort(), |
120
|
|
|
'password' => $this->getPassword() ?: null, |
|
|
|
|
121
|
|
|
'database' => $this->getDatabase(), |
122
|
|
|
]; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @return \Predis\Client|null |
127
|
|
|
*/ |
128
|
|
|
public function getPredisClient() |
129
|
|
|
{ |
130
|
|
|
return $this->predisClient; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @param \Predis\Client $predisClient|null |
135
|
|
|
* @return Config |
136
|
|
|
*/ |
137
|
|
|
public function setPredisClient(\Predis\Client $predisClient = null): Config |
138
|
|
|
{ |
139
|
|
|
$this->predisClient = $predisClient; |
140
|
|
|
return $this; |
141
|
|
|
} |
142
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths