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 |
|
|
|
|
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
|
|
|
|
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.