RabbitResponseException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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