@@ -43,7 +43,7 @@ |
||
43 | 43 | $channel = $connection->channel(); |
44 | 44 | $queueBag = new SubscriberQueueBag($this->getExchange(), $this->getExchangeType(), $this->getQueueName()); |
45 | 45 | $channel->exchangeDeclare($queueBag->getExchangeDeclare()); |
46 | - $msg = new CmobiAMQPMessage((string) $data); |
|
46 | + $msg = new CmobiAMQPMessage((string)$data); |
|
47 | 47 | $channel->basic_publish($msg, $queueBag->getExchange()); |
48 | 48 | |
49 | 49 | $channel->close(); |
@@ -35,13 +35,13 @@ |
||
35 | 35 | $connection = $this->connectionManager->getConnection(); |
36 | 36 | $channel = $connection->channel(); |
37 | 37 | |
38 | - if (! $this->queueHasExists($channel)) { |
|
38 | + if (!$this->queueHasExists($channel)) { |
|
39 | 39 | throw new QueueNotFoundException("Queue $this->queueName not declared."); |
40 | 40 | } |
41 | 41 | $queueBag = new WorkerQueueBag($this->getQueueName()); |
42 | 42 | $channel->queueDeclare($queueBag->getQueueDeclare()); |
43 | 43 | $msg = new CmobiAMQPMessage( |
44 | - (string) $data, |
|
44 | + (string)$data, |
|
45 | 45 | [ |
46 | 46 | 'delivery_mode' => 2, // make message persistent |
47 | 47 | 'priority' => $priority, |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | $connection = $this->connectionManager->getConnection($this->connectionName); |
87 | 87 | $channel = $connection->channel(); |
88 | 88 | |
89 | - if (! $this->queueHasExists($channel)) { |
|
89 | + if (!$this->queueHasExists($channel)) { |
|
90 | 90 | throw new QueueNotFoundException("Queue $this->queueName not declared."); |
91 | 91 | } |
92 | 92 | $this->createCallbackQueue($channel, $expire); |
93 | 93 | $msg = new CmobiAMQPMessage( |
94 | - (string) $data, |
|
94 | + (string)$data, |
|
95 | 95 | [ |
96 | 96 | 'correlation_id' => $this->correlationId, |
97 | 97 | 'reply_to' => $this->callbackQueue, |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ); |
101 | 101 | $channel->basic_publish($msg, '', $this->getQueueName()); |
102 | 102 | |
103 | - while (! $this->response) { |
|
103 | + while (!$this->response) { |
|
104 | 104 | try { |
105 | 105 | $channel->wait(null, 0, ($expire / 1000)); |
106 | 106 | } catch (\Exception $e) { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | /** @return string */ |
171 | 171 | public function generateCorrelationId() |
172 | 172 | { |
173 | - return uniqid($this->getQueueName()) . Uuid::uuid4()->toString() . microtime(); |
|
173 | + return uniqid($this->getQueueName()).Uuid::uuid4()->toString().microtime(); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -217,17 +217,17 @@ discard block |
||
217 | 217 | try { |
218 | 218 | $connection->close(); |
219 | 219 | $failed = false; |
220 | - fwrite($this->logOutput, 'start RpcClient::forceReconnect() - trying connect...' . PHP_EOL); |
|
220 | + fwrite($this->logOutput, 'start RpcClient::forceReconnect() - trying connect...'.PHP_EOL); |
|
221 | 221 | $connection = $this->getConnectionManager()->getConnection($this->connectionName); |
222 | 222 | $channel = $connection->channel(); |
223 | 223 | $this->createCallbackQueue($channel, $expire, $corralationId); |
224 | 224 | } catch (\Exception $e) { |
225 | 225 | $failed = true; |
226 | 226 | sleep(3); |
227 | - fwrite($this->errOutput, 'failed RpcClient::forceReconnect() - ' . $e->getMessage() . PHP_EOL); |
|
227 | + fwrite($this->errOutput, 'failed RpcClient::forceReconnect() - '.$e->getMessage().PHP_EOL); |
|
228 | 228 | } |
229 | 229 | } while ($failed); |
230 | - fwrite($this->logOutput, 'RpcClient::forceReconnect() - connected!' . PHP_EOL); |
|
230 | + fwrite($this->logOutput, 'RpcClient::forceReconnect() - connected!'.PHP_EOL); |
|
231 | 231 | |
232 | 232 | return $connection; |
233 | 233 | } |