RabbitResponseException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 24
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRabbitResponse() 0 3 1
1
<?php
2
namespace pmill\RabbitRabbit\Exceptions;
3
4
class RabbitResponseException extends \Exception
5
{
6
    /**
7
     * @var array
8
     */
9
    protected $rabbitResponse;
10
11
    /**
12
     * RabbitResponseException constructor.
13
     *
14
     * @param array $rabbitResponse
15
     */
16 1
    public function __construct(array $rabbitResponse)
17
    {
18 1
        $this->rabbitResponse = $rabbitResponse;
19 1
        parent::__construct(json_encode($rabbitResponse));
20 1
    }
21
22
    /**
23
     * @return array
24
     */
25
    public function getRabbitResponse(): array
26
    {
27
        return $this->rabbitResponse;
28
    }
29
}
30