Passed
Push — master ( ff2040...6f6996 )
by KwangSeob
02:18
created

AbstractConfiguration::getUseV3RestApi()   A

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 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace JiraRestApi\Configuration;
4
5
/**
6
 * Class AbstractConfiguration.
7
 */
8
abstract class AbstractConfiguration implements ConfigurationInterface
9
{
10
    /**
11
     * Jira host.
12
     *
13
     * @var string
14
     */
15
    protected $jiraHost;
16
17
    /**
18
     * Jira login.
19
     *
20
     * @var string
21
     */
22
    protected $jiraUser;
23
24
    /**
25
     * Jira password.
26
     *
27
     * @var string
28
     */
29
    protected $jiraPassword;
30
31
    /**
32
     * Enabled write to log.
33
     *
34
     * @var bool
35
     */
36
    protected $jiraLogEnabled;
37
38
    /**
39
     * Path to log file.
40
     *
41
     * @var string
42
     */
43
    protected $jiraLogFile;
44
45
    /**
46
     * Log level (DEBUG, INFO, ERROR, WARNING).
47
     *
48
     * @var string
49
     */
50
    protected $jiraLogLevel;
51
52
    /**
53
     * Curl options CURLOPT_SSL_VERIFYHOST.
54
     *
55
     * @var bool
56
     */
57
    protected $curlOptSslVerifyHost;
58
59
    /**
60
     * Curl options CURLOPT_SSL_VERIFYPEER.
61
     *
62
     * @var bool
63
     */
64
    protected $curlOptSslVerifyPeer;
65
66
    /**
67
     * Curl option CURLOPT_USERAGENT.
68
     *
69
     * @var string
70
     */
71
    protected $curlOptUserAgent;
72
73
    /**
74
     * Curl options CURLOPT_VERBOSE.
75
     *
76
     * @var bool
77
     */
78
    protected $curlOptVerbose;
79
80
    /**
81
     * HTTP header 'Authorization: Bearer {token}' for OAuth.
82
     *
83
     * @var string
84
     */
85
    protected $oauthAccessToken;
86
87
    /**
88
     * enable cookie authorization.
89
     *
90
     * @var bool
91
     */
92
    protected $cookieAuthEnabled;
93
94
    /**
95
     * HTTP cookie file name.
96
     *
97
     * @var string
98
     */
99
    protected $cookieFile;
100
101
    /**
102
     * Proxy server.
103
     *
104
     * @var string
105
     */
106
    protected $proxyServer;
107
108
    /**
109
     * Proxy port.
110
     *
111
     * @var string
112
     */
113
    protected $proxyPort;
114
115
    /**
116
     * Proxy user.
117
     *
118
     * @var string
119
     */
120
    protected $proxyUser;
121
122
    /**
123
     * Proxy password.
124
     *
125
     * @var string
126
     */
127
    protected $proxyPassword;
128
129
    /**
130
     * Use Jira Cloud REST API v3.
131
     *
132
     * @var bool
133
     */
134
    protected $useV3RestApi;
135
136
    /**
137
     * @return string
138
     */
139
    public function getJiraHost()
140
    {
141
        return $this->jiraHost;
142
    }
143
144
    /**
145
     * @return string
146
     */
147
    public function getJiraUser()
148
    {
149
        return $this->jiraUser;
150
    }
151
152
    /**
153
     * @return string
154
     */
155
    public function getJiraPassword()
156
    {
157
        return $this->jiraPassword;
158
    }
159
160
    /**
161
     * @return bool
162
     */
163
    public function getJiraLogEnabled()
164
    {
165
        return $this->jiraLogEnabled;
166
    }
167
168
    /**
169
     * @return string
170
     */
171
    public function getJiraLogFile()
172
    {
173
        return $this->jiraLogFile;
174
    }
175
176
    /**
177
     * @return string
178
     */
179
    public function getJiraLogLevel()
180
    {
181
        return $this->jiraLogLevel;
182
    }
183
184
    /**
185
     * @return bool
186
     */
187
    public function isCurlOptSslVerifyHost()
188
    {
189
        return $this->curlOptSslVerifyHost;
190
    }
191
192
    /**
193
     * @return bool
194
     */
195
    public function isCurlOptSslVerifyPeer()
196
    {
197
        return $this->curlOptSslVerifyPeer;
198
    }
199
200
    /**
201
     * @return bool
202
     */
203
    public function isCurlOptVerbose()
204
    {
205
        return $this->curlOptVerbose;
206
    }
207
208
    /**
209
     * Get curl option CURLOPT_USERAGENT.
210
     *
211
     * @return string
212
     */
213
    public function getCurlOptUserAgent()
214
    {
215
        return $this->curlOptUserAgent;
216
    }
217
218
    /**
219
     * @return string
220
     */
221
    public function getOAuthAccessToken()
222
    {
223
        return $this->oauthAccessToken;
224
    }
225
226
    /**
227
     * @return string
228
     */
229
    public function isCookieAuthorizationEnabled()
230
    {
231
        return $this->cookieAuthEnabled;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->cookieAuthEnabled returns the type boolean which is incompatible with the documented return type string.
Loading history...
232
    }
233
234
    /**
235
     * get default User-Agent String.
236
     *
237
     * @return string
238
     */
239
    public function getDefaultUserAgentString()
240
    {
241
        $curlVersion = curl_version();
242
243
        return sprintf('curl/%s (%s)', $curlVersion['version'], $curlVersion['host']);
244
    }
245
246
    /**
247
     * @return string
248
     */
249
    public function getCookieFile()
250
    {
251
        return $this->cookieFile;
252
    }
253
254
    /**
255
     * @return string
256
     */
257
    public function getProxyServer()
258
    {
259
        return $this->proxyServer;
260
    }
261
262
    /**
263
     * @return string
264
     */
265
    public function getProxyPort()
266
    {
267
        return $this->proxyPort;
268
    }
269
270
    /**
271
     * @return string
272
     */
273
    public function getProxyUser()
274
    {
275
        return $this->proxyUser;
276
    }
277
278
    /**
279
     * @return string
280
     */
281
    public function getProxyPassword()
282
    {
283
        return $this->proxyPassword;
284
    }
285
286
    /**
287
     * @return bool
288
     */
289
    public function getUseV3RestApi()
290
    {
291
        return $this->useV3RestApi;
292
    }
293
}
294