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

UnknownErrorResponseException::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
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