Completed
Push — master ( 4447aa...e37fbd )
by Vasily
09:14 queued 04:58
created

BasicConsumeFrame::create()   D

Complexity

Conditions 8
Paths 128

Size

Total Lines 30
Code Lines 18

Duplication

Lines 30
Ratio 100 %

Importance

Changes 0
Metric Value
cc 8
eloc 18
nc 128
nop 7
dl 30
loc 30
rs 4.6666
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\MethodFrame;
6
use PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\OutgoingFrame;
7
8
/**
9
 * Class BasicConsumeFrame
10
 * @author Aleksey I. Kuleshov YOU GLOBAL LIMITED
11
 * @package PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Basic
12
 */
13 View Code Duplication
class BasicConsumeFrame implements MethodFrame, OutgoingFrame
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    const METHOD_ID = 0x003c0014;
16
17
    public $frameChannelId = 0;
18
    public $reserved1 = 0; // short
19
    public $queue = ''; // shortstr
20
    public $consumerTag = ''; // shortstr
21
    public $noLocal = false; // bit
22
    public $noAck = false; // bit
23
    public $exclusive = false; // bit
24
    public $nowait = false; // bit
25
    public $arguments = []; // table
26
27
    public static function create(
28
        $queue = null, $consumerTag = null, $noLocal = null, $noAck = null, $exclusive = null, $nowait = null, $arguments = null
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 128 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
29
    )
30
    {
31
        $frame = new self();
32
33
        if (null !== $queue) {
34
            $frame->queue = $queue;
35
        }
36
        if (null !== $consumerTag) {
37
            $frame->consumerTag = $consumerTag;
38
        }
39
        if (null !== $noLocal) {
40
            $frame->noLocal = $noLocal;
41
        }
42
        if (null !== $noAck) {
43
            $frame->noAck = $noAck;
44
        }
45
        if (null !== $exclusive) {
46
            $frame->exclusive = $exclusive;
47
        }
48
        if (null !== $nowait) {
49
            $frame->nowait = $nowait;
50
        }
51
        if (null !== $arguments) {
52
            $frame->arguments = $arguments;
53
        }
54
55
        return $frame;
56
    }
57
}
58