Completed
Push — master ( 0ef30a...eb3939 )
by Kevin
03:35
created

ClientException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getResponseBody() 0 4 1
1
<?php
2
3
namespace PCextreme\Cloudstack\Exception;
4
5
use Exception;
6
7
class ClientException extends Exception
8
{
9
    /**
10
     * @var mixed
11
     */
12
    protected $response;
13
14
    /**
15
     * @param  string        $message
16
     * @param  int           $code
17
     * @param  array|string  $response
18
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
19
     */
20
    public function __construct($message, $code, $response)
21
    {
22
        $this->response = $response;
23
24
        parent::__construct($message, $code);
25
    }
26
27
    /**
28
     * Returns the exception's response body.
29
     *
30
     * @return array|string
31
     */
32
    public function getResponseBody()
33
    {
34
        return $this->response;
35
    }
36
}
37