HTTPRequestException::getMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace dokuwiki\plugin\issuelinks\classes;
4
5
/**
6
 * Class HTTPRequestException
7
 *
8
 * A translatable exception
9
 *
10
 * @package dokuwiki\plugin\issuelinks\classes
11
 */
12
class HTTPRequestException extends IssueLinksException
13
{
14
    protected $httpError;
15
    protected $responseBody;
16
    protected $url;
17
    protected $method;
18
19
    public function __construct($message, \DokuHTTPClient $httpClient, $url, $method)
20
    {
21
        $this->code = $httpClient->status;
22
        $this->httpError = $httpClient->error;
23
        $this->responseBody = $httpClient->resp_body;
24
        $this->url = $url;
25
        $this->method = $method;
26
27
        parent::__construct($message, $this->getCode(), $this->httpError);
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getHttpError()
34
    {
35
        return $this->httpError;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getResponseBody()
42
    {
43
        return $this->responseBody;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getUrl()
50
    {
51
        return $this->url;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getMethod()
58
    {
59
        return $this->method;
60
    }
61
}
62