AMQPLoggedChannel::getBasicPublishLog()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace OldSound\RabbitMqBundle\RabbitMq;
4
5
use PhpAmqpLib\Channel\AMQPChannel;
6
7
/**
8
 * AMQPLoggedChannel.
9
 *
10
 * @author Marc Weistroff <[email protected]>
11
 */
12
class AMQPLoggedChannel extends AMQPChannel
13
{
14
    private $basicPublishLog = [];
15
16
    public function basic_publish($msg, $exchange = '', $routingKey = '', $mandatory = false, $immediate = false, $ticket = null)
17
    {
18
        $this->basicPublishLog[] = [
19
            'msg'         => $msg,
20
            'exchange'    => $exchange,
21
            'routing_key' => $routingKey,
22
            'mandatory'   => $mandatory,
23
            'immediate'   => $immediate,
24
            'ticket'      => $ticket,
25
        ];
26
27
        parent::basic_publish($msg, $exchange, $routingKey, $mandatory, $immediate, $ticket);
28
    }
29
30
    public function getBasicPublishLog()
31
    {
32
        return $this->basicPublishLog;
33
    }
34
}
35