Completed
Push — master ( 3cf178...59e65f )
by Ryosuke
03:33
created

HttpException   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 33.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 32
ccs 6
cts 18
cp 0.3333
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getStatusCode() 0 4 1
A getReasonPhrase() 0 4 1
A getHandle() 0 4 1
A getResponse() 0 4 1
1
<?php
2
3
namespace mpyw\Cowitter;
4
5
use mpyw\Cowitter\Response;
6
7
class HttpException extends \RuntimeException implements HttpExceptionInterface
8
{
9
    protected $ch;
10
    protected $response;
11
12 7
    public function __construct($message, $code, $ch, Response $response)
13 7
    {
14 7
        parent::__construct($message, $code);
15 7
        $this->ch = $ch;
16 7
        $this->response = $response;
17 7
    }
18
19
    public function getStatusCode()
20
    {
21
        return $this->response->getStatusCode();
22
    }
23
24
    public function getReasonPhrase()
25
    {
26
        return $this->response->getReasonPhrase();
27
    }
28
29
    public function getHandle()
30
    {
31
        return $this->ch;
32
    }
33
34
    public function getResponse()
35
    {
36
        return $this->response;
37
    }
38
}
39