Returned   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 38.89%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 81
ccs 7
cts 18
cp 0.3889
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
A getExchange() 0 4 1
A getRoutingKey() 0 4 1
A __debugInfo() 0 9 1
1
<?php
2
3
namespace ButterAMQP;
4
5
/**
6
 * Message returned back to the publisher.
7
 */
8
class Returned extends Message
9
{
10
    /**
11
     * @var string
12
     */
13
    private $exchange;
14
15
    /**
16
     * @var string
17
     */
18
    private $routingKey;
19
20
    /**
21
     * @var int
22
     */
23
    private $replyCode;
24
25
    /**
26
     * @var string
27
     */
28
    private $replyText;
29
30
    /**
31
     * @param int    $replyCode
32
     * @param string $replyText
33
     * @param string $exchange
34
     * @param string $routingKey
35
     * @param string $body
36
     * @param array  $properties
37
     */
38 2
    public function __construct(
39
        $replyCode,
40
        $replyText,
41
        $exchange,
42
        $routingKey,
43
        $body,
44
        array $properties
45
    ) {
46 2
        $this->replyCode = $replyCode;
47 2
        $this->replyText = $replyText;
48 2
        $this->exchange = $exchange;
49 2
        $this->routingKey = $routingKey;
50
51 2
        parent::__construct($body, $properties);
52 2
    }
53
54
    /**
55
     * Exchange where message was sent initially.
56
     *
57
     * @return string
58
     */
59
    public function getExchange()
60
    {
61
        return $this->exchange;
62
    }
63
64
    /**
65
     * Routing key.
66
     *
67
     * @return string
68
     */
69
    public function getRoutingKey()
70
    {
71
        return $this->routingKey;
72
    }
73
74
    /**
75
     * Define how to print object when dumping.
76
     *
77
     * @return array
78
     */
79
    public function __debugInfo()
80
    {
81
        return array_merge(parent::__debugInfo(), [
82
            'reply_code' => $this->replyCode,
83
            'reply_text' => $this->replyText,
84
            'exchange' => $this->exchange,
85
            'routing_key' => $this->routingKey,
86
        ]);
87
    }
88
}
89