Passed
Push — master ( 01bab4...e0f3b3 )
by KwangSeob
03:09
created

AbstractConfiguration::isCurlOptSslVerifyPeer()   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
     * Path to log file.
33
     *
34
     * @var string
35
     */
36
    protected $jiraLogFile;
37
38
    /**
39
     * Log level (DEBUG, INFO, ERROR, WARNING).
40
     *
41
     * @var string
42
     */
43
    protected $jiraLogLevel;
44
45
    /**
46
     * Curl options CURLOPT_SSL_VERIFYHOST.
47
     *
48
     * @var bool
49
     */
50
    protected $curlOptSslVerifyHost;
51
52
    /**
53
     * Curl options CURLOPT_SSL_VERIFYPEER.
54
     *
55
     * @var bool
56
     */
57
    protected $curlOptSslVerifyPeer;
58
59
    /**
60
     * Curl option CURLOPT_USERAGENT.
61
     *
62
     * @var string
63
     */
64
    protected $curlOptUserAgent;
65
66
    /**
67
     * Curl options CURLOPT_VERBOSE.
68
     *
69
     * @var bool
70
     */
71
    protected $curlOptVerbose;
72
73
    /**
74
     * HTTP header 'Authorization: Bearer {token}' for OAuth.
75
     *
76
     * @var string
77
     */
78
    protected $oauthAccessToken;
79
80
    /**
81
     * enable cookie authorization.
82
     *
83
     * @var bool
84
     */
85
    protected $cookieAuthEnabled;
86
87
    /**
88
     * HTTP cookie file name.
89
     *
90
     * @var string
91
     */
92
    protected $cookieFile;
93
94
    /**
95
     * @return string
96
     */
97
    public function getJiraHost()
98
    {
99
        return $this->jiraHost;
100
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function getJiraUser()
106
    {
107
        return $this->jiraUser;
108
    }
109
110
    /**
111
     * @return string
112
     */
113
    public function getJiraPassword()
114
    {
115
        return $this->jiraPassword;
116
    }
117
118
    /**
119
     * @return string
120
     */
121
    public function getJiraLogFile()
122
    {
123
        return $this->jiraLogFile;
124
    }
125
126
    /**
127
     * @return string
128
     */
129
    public function getJiraLogLevel()
130
    {
131
        return $this->jiraLogLevel;
132
    }
133
134
    /**
135
     * @return bool
136
     */
137
    public function isCurlOptSslVerifyHost()
138
    {
139
        return $this->curlOptSslVerifyHost;
140
    }
141
142
    /**
143
     * @return bool
144
     */
145
    public function isCurlOptSslVerifyPeer()
146
    {
147
        return $this->curlOptSslVerifyPeer;
148
    }
149
150
    /**
151
     * @return bool
152
     */
153
    public function isCurlOptVerbose()
154
    {
155
        return $this->curlOptVerbose;
156
    }
157
158
    /**
159
     * Get curl option CURLOPT_USERAGENT.
160
     *
161
     * @return string
162
     */
163
    public function getCurlOptUserAgent()
164
    {
165
        return $this->curlOptUserAgent;
166
    }
167
168
    /**
169
     * @return string
170
     */
171
    public function getOAuthAccessToken()
172
    {
173
        return $this->oauthAccessToken;
174
    }
175
176
    /**
177
     * @return string
178
     */
179
    public function isCookieAuthorizationEnabled()
180
    {
181
        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...
182
    }
183
184
    /**
185
     * get default User-Agent String
186
     *
187
     * @return string
188
     */
189
    public function getDefaultUserAgentString()
190
    {
191
        $curlVersion = curl_version();
192
193
        return sprintf('curl/%s (%s)', $curlVersion['version'], $curlVersion['host']);
194
    }
195
196
    /**
197
     * @return string
198
     */
199
    public function getCookieFile()
200
    {
201
        return $this->cookieFile;
202
    }
203
}
204