@@ -108,7 +108,9 @@ discard block |
||
| 108 | 108 | public function makeConnection(string $name) |
| 109 | 109 | { |
| 110 | 110 | $config = $this->configuration($name); |
| 111 | - if (isset($config['host'])) $config = [$config]; |
|
| 111 | + if (isset($config['host'])) { |
|
| 112 | + $config = [$config]; |
|
| 113 | + } |
|
| 112 | 114 | return AMQPStreamConnection::create_connection($config); |
| 113 | 115 | } |
| 114 | 116 | |
@@ -362,8 +364,11 @@ discard block |
||
| 362 | 364 | $channel->queue_bind($this->getQueue(), $this->getExchange()); |
| 363 | 365 | |
| 364 | 366 | if (!$message instanceof AMQPMessage) { |
| 365 | - if (is_array($message) || is_object($message)) $message = json_encode($message); |
|
| 366 | - elseif ($message instanceof Collection) $message = $message->toJson(); |
|
| 367 | + if (is_array($message) || is_object($message)) { |
|
| 368 | + $message = json_encode($message); |
|
| 369 | + } elseif ($message instanceof Collection) { |
|
| 370 | + $message = $message->toJson(); |
|
| 371 | + } |
|
| 367 | 372 | $message = new AMQPMessage($message, ['content_type' => 'text/plain', 'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT]); |
| 368 | 373 | } |
| 369 | 374 | |