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

ExchangeDeclareFrame   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 49
rs 10
c 0
b 0
f 0
wmc 9
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
F create() 0 33 9
1
<?php
2
3
namespace PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Exchange;
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 ExchangeDeclareFrame
10
 * @author Aleksey I. Kuleshov YOU GLOBAL LIMITED
11
 * @package PHPDaemon\Clients\AMQP\Driver\Protocol\v091\Protocol\Exchange
12
 */
13
class ExchangeDeclareFrame implements MethodFrame, OutgoingFrame
14
{
15
    const METHOD_ID = 0x0028000a;
16
17
    public $frameChannelId = 0;
18
    public $reserved1 = 0; // short
19
    public $exchange; // shortstr
20
    public $type = 'direct'; // shortstr
21
    public $passive = false; // bit
22
    public $durable = false; // bit
23
    public $autoDelete = false; // bit
24
    public $internal = false; // bit
25
    public $nowait = false; // bit
26
    public $arguments = []; // table
27
28
    public static function create(
29
        $exchange = null, $type = null, $passive = null, $durable = null, $autoDelete = null, $internal = null, $nowait = null, $arguments = null
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 145 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...
30
    )
31
    {
32
        $frame = new self();
33
34
        if (null !== $exchange) {
35
            $frame->exchange = $exchange;
36
        }
37
        if (null !== $type) {
38
            $frame->type = $type;
39
        }
40
        if (null !== $passive) {
41
            $frame->passive = $passive;
42
        }
43
        if (null !== $durable) {
44
            $frame->durable = $durable;
45
        }
46
        if (null !== $autoDelete) {
47
            $frame->autoDelete = $autoDelete;
48
        }
49
        if (null !== $internal) {
50
            $frame->internal = $internal;
51
        }
52
        if (null !== $nowait) {
53
            $frame->nowait = $nowait;
54
        }
55
        if (null !== $arguments) {
56
            $frame->arguments = $arguments;
57
        }
58
59
        return $frame;
60
    }
61
}
62