1 | <?php |
||
11 | class InMemory implements Client |
||
12 | { |
||
13 | use \Psr\Log\LoggerAwareTrait; |
||
14 | |||
15 | private |
||
16 | $sentMessages; |
||
1 ignored issue
–
show
|
|||
17 | |||
18 | 15 | public function __construct() |
|
23 | |||
24 | 9 | public function publish($exchangeName, WritableMessage $message) |
|
25 | { |
||
26 | 9 | $this->updateMessageAttributes($message); |
|
27 | 9 | $this->saveMessage($exchangeName, $message); |
|
28 | 9 | } |
|
29 | |||
30 | 9 | private function updateMessageAttributes(WritableMessage $message) |
|
31 | { |
||
32 | 9 | $message->setAttribute('app_id', 'memory'); |
|
33 | 9 | $message->addHeader('routing_key', $message->getRoutingKey()); |
|
34 | 9 | } |
|
35 | |||
36 | 1 | public function getQueue($queueName) |
|
40 | |||
41 | public function getExchange($exchangeName) |
||
45 | |||
46 | 9 | private function saveMessage($exchangeName, WritableMessage $message) |
|
53 | |||
54 | 9 | public function getSentMessages() |
|
58 | |||
59 | 1 | public function dropSentMessages() |
|
65 | } |
||
66 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.