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

BasicNackFrame::create()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 10
nc 8
nop 3
dl 0
loc 18
rs 9.2
c 0
b 0
f 0
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