Config::setPassword()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 *
5
 * This file is part of Phpfastcache.
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For full copyright and license information, please see the docs/CREDITS.txt and LICENCE files.
10
 *
11
 * @author Georges.L (Geolim4)  <[email protected]>
12
 * @author Contributors  https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
13
 */
14
15
declare(strict_types=1);
16
17
namespace Phpfastcache\Drivers\Cassandra;
18
19
use Phpfastcache\Config\ConfigurationOption;
20
use Phpfastcache\Exceptions\PhpfastcacheLogicException;
21
22
class Config extends ConfigurationOption
23
{
24
    protected string $host = '127.0.0.1';
25
26
    protected int $port = 9042;
27
28
    protected int $timeout = 2;
29
30
    protected string $username = '';
31
32
    protected string $password = '';
33
34
    protected bool $sslEnabled = false;
35
36
    protected bool $sslVerify = false;
37
38
    protected bool $useLegacyExecutionOptions = false;
39
40
    public function getHost(): string
41
    {
42
        return $this->host;
43
    }
44
45
    /**
46
     * @param string $host
47
     * @throws PhpfastcacheLogicException
48
     */
49
    public function setHost(string $host): static
50
    {
51
        return $this->setProperty('host', $host);
52
    }
53
54
    /**
55
     * @return int
56
     */
57
    public function getPort(): int
58
    {
59
        return $this->port;
60
    }
61
62
    /**
63
     * @param int $port
64
     * @throws PhpfastcacheLogicException
65
     */
66
    public function setPort(int $port): static
67
    {
68
        return $this->setProperty('port', $port);
69
    }
70
71
    /**
72
     * @return int
73
     */
74
    public function getTimeout(): int
75
    {
76
        return $this->timeout;
77
    }
78
79
    /**
80
     * @param int $timeout
81
     * @throws PhpfastcacheLogicException
82
     */
83
    public function setTimeout(int $timeout): static
84
    {
85
        return $this->setProperty('timeout', $timeout);
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getUsername(): string
92
    {
93
        return $this->username;
94
    }
95
96
    /**
97
     * @param string $username
98
     * @throws PhpfastcacheLogicException
99
     */
100
    public function setUsername(string $username): static
101
    {
102
        return $this->setProperty('username', $username);
103
    }
104
105
    /**
106
     * @return string
107
     */
108
    public function getPassword(): string
109
    {
110
        return $this->password;
111
    }
112
113
    /**
114
     * @param string $password
115
     * @throws PhpfastcacheLogicException
116
     */
117
    public function setPassword(string $password): static
118
    {
119
        return $this->setProperty('password', $password);
120
    }
121
122
    /**
123
     * @return bool
124
     */
125
    public function isSslEnabled(): bool
126
    {
127
        return $this->sslEnabled;
128
    }
129
130
    /**
131
     * @param bool $sslEnabled
132
     * @throws PhpfastcacheLogicException
133
     */
134
    public function setSslEnabled(bool $sslEnabled): static
135
    {
136
        return $this->setProperty('sslEnabled', $sslEnabled);
137
    }
138
139
    /**
140
     * @return bool
141
     */
142
    public function isSslVerify(): bool
143
    {
144
        return $this->sslVerify;
145
    }
146
147
    /**
148
     * @param bool $sslVerify
149
     * @throws PhpfastcacheLogicException
150
     */
151
    public function setSslVerify(bool $sslVerify): static
152
    {
153
        return $this->setProperty('sslVerify', $sslVerify);
154
    }
155
156
    /**
157
     * @return bool
158
     */
159
    public function isUseLegacyExecutionOptions(): bool
160
    {
161
        return $this->useLegacyExecutionOptions;
162
    }
163
164
    /**
165
     * @param bool $useLegacyExecutionOptions
166
     * @throws PhpfastcacheLogicException
167
     */
168
    public function setUseLegacyExecutionOptions(bool $useLegacyExecutionOptions): static
169
    {
170
        return $this->setProperty('useLegacyExecutionOptions', $useLegacyExecutionOptions);
171
    }
172
}
173