Completed
Push — master ( 582eeb...234de9 )
by Massimiliano
03:05
created

UnknownErrorResponseException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 35
ccs 4
cts 10
cp 0.4
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __toString() 0 7 1
A getResponse() 0 4 1
1
<?php
2
3
namespace Fazland\SkebbyRestClient\Exception;
4
5
/**
6
 * @author Massimiliano Braglia <[email protected]>
7
 */
8
class UnknownErrorResponseException extends Exception
9
{
10
    /**
11
     * @var string
12
     */
13
    private $response;
14
15
    /**
16
     * UnknownErrorResponseException constructor.
17
     * @param string $message
18
     * @param string $response
19
     */
20 1
    public function __construct($message = '', $response = null)
21
    {
22 1
        $this->response = $response;
23
24 1
        parent::__construct($message);
25 1
    }
26
27
    public function __toString()
28
    {
29
        return '[' . get_class($this) . '] ' . $this->message . "\n" .
30
            'Response: ' . "\n" .
31
            $this->response
32
        ;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getResponse()
39
    {
40
        return $this->response;
41
    }
42
}
43