HTTPRequestException   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 48
ccs 0
cts 24
cp 0
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponseBody() 0 3 1
A getUrl() 0 3 1
A getMethod() 0 3 1
A getHttpError() 0 3 1
A __construct() 0 9 1
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