ResponseException::getResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the slince/smartqq package.
4
 *
5
 * (c) Slince <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Slince\SmartQQ\Exception;
12
13
class ResponseException extends RuntimeException
14
{
15
    protected $response;
16
17
    public function __construct($code, $response = null, $message = null)
18
    {
19
        if (!is_null($response)) {
20
            $this->response = $response;
21
        }
22
        $message = $message ?: 'The response is incorrect';
23
        parent::__construct($message, $code);
24
    }
25
26
    /**
27
     * @param null $response
28
     */
29
    public function setResponse($response)
30
    {
31
        $this->response = $response;
32
    }
33
34
    public function getResponse()
35
    {
36
        return $this->response;
37
    }
38
}
39