ResponseException   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
A setResponse() 0 4 1
A getResponse() 0 4 1
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