Completed
Pull Request — master (#286)
by
unknown
06:13
created

BasicNackFrame   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 18 4
1
<?php
2
3
namespace PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Basic;
4
5
use PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\IncomingFrame;
6
use PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\MethodFrame;
7
use PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\OutgoingFrame;
8
9
/**
10
 * Class BasicNackFrame
11
 * @author Aleksey I. Kuleshov YOU GLOBAL LIMITED
12
 * @package PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Basic
13
 */
14
class BasicNackFrame implements MethodFrame, IncomingFrame, OutgoingFrame
15
{
16
    const METHOD_ID = 0x003c0078;
17
18
    public $frameChannelId = 0;
19
    public $deliveryTag = 0; // longlong
20
    public $multiple = false; // bit
21
    public $requeue = true; // bit
22
23
    public static function create(
24
        $deliveryTag = null, $multiple = null, $requeue = null
25
    )
26
    {
27
        $frame = new self();
28
29
        if (null !== $deliveryTag) {
30
            $frame->deliveryTag = $deliveryTag;
31
        }
32
        if (null !== $multiple) {
33
            $frame->multiple = $multiple;
34
        }
35
        if (null !== $requeue) {
36
            $frame->requeue = $requeue;
37
        }
38
39
        return $frame;
40
    }
41
}
42