@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function onResponse(AMQPMessage $rep) |
| 32 | 32 | { |
| 33 | - if($rep->get('correlation_id') === $this->correlationId) { |
|
| 33 | + if ($rep->get('correlation_id') === $this->correlationId) { |
|
| 34 | 34 | $this->response = $rep->getBody(); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $connection = $this->connectionManager->getConnection(); |
| 45 | 45 | |
| 46 | - if (! $connection->isConnected()) { |
|
| 46 | + if (!$connection->isConnected()) { |
|
| 47 | 47 | $connection->reconnect(); |
| 48 | 48 | } |
| 49 | 49 | $this->channel = $connection->channel(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $queueBag->setArguments([ |
| 67 | 67 | 'x-expires' => ['I', $expire] |
| 68 | 68 | ]); |
| 69 | - list($callbackQueue, ,) = $this->getChannel()->queueDeclare($queueBag->getQueueDeclare()); |
|
| 69 | + list($callbackQueue,,) = $this->getChannel()->queueDeclare($queueBag->getQueueDeclare()); |
|
| 70 | 70 | $this->callbackQueue = $callbackQueue; |
| 71 | 71 | $consumeQueueBag = new RpcQueueBag($callbackQueue); |
| 72 | 72 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ); |
| 85 | 85 | $this->getChannel()->basic_publish($msg, '', $this->getQueueName()); |
| 86 | 86 | |
| 87 | - while(! $this->response) { |
|
| 87 | + while (!$this->response) { |
|
| 88 | 88 | $this->getChannel()->wait(null, 0, ($expire / 1000)); |
| 89 | 89 | } |
| 90 | 90 | $this->getChannel()->close(); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | /** @return string */ |
| 137 | 137 | public function generateCorrelationId() |
| 138 | 138 | { |
| 139 | - return uniqid($this->getQueueName()) . microtime(); |
|
| 139 | + return uniqid($this->getQueueName()).microtime(); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function toClosure() |
| 31 | 31 | { |
| 32 | - return function (AMQPMessage $message) { |
|
| 32 | + return function(AMQPMessage $message) { |
|
| 33 | 33 | $response = $this->getQueueService()->handle($message); |
| 34 | 34 | |
| 35 | 35 | $amqpResponse = new CmobiAMQPMessage( |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function toClosure() |
| 30 | 30 | { |
| 31 | - return function (AMQPMessage $message) { |
|
| 31 | + return function(AMQPMessage $message) { |
|
| 32 | 32 | $this->getQueueService()->handle($message); |
| 33 | 33 | }; |
| 34 | 34 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | /** @var CmobiAMQPConnectionInterface $connection */ |
| 59 | 59 | $connection = $this->connectionManager->getConnection(); |
| 60 | 60 | |
| 61 | - if (! $connection->isConnected()) { |
|
| 61 | + if (!$connection->isConnected()) { |
|
| 62 | 62 | $connection->reconnect(); |
| 63 | 63 | } |
| 64 | 64 | $this->channel = $connection->channel(); |
@@ -5,6 +5,6 @@ |
||
| 5 | 5 | class ExchangeType |
| 6 | 6 | { |
| 7 | 7 | const FANOUT = 'fanout'; |
| 8 | - const DIRECT = 'direct'; |
|
| 8 | + const DIRECT = 'direct'; |
|
| 9 | 9 | const TOPIC = 'topic'; |
| 10 | 10 | } |
| 11 | 11 | \ No newline at end of file |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | /** @var CmobiAMQPConnectionInterface $connection */ |
| 55 | 55 | $connection = $this->connectionManager->getConnection(); |
| 56 | 56 | |
| 57 | - if (! $connection->isConnected()) { |
|
| 57 | + if (!$connection->isConnected()) { |
|
| 58 | 58 | $connection->reconnect(); |
| 59 | 59 | } |
| 60 | 60 | $this->channel = $connection->channel(); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function toClosure() |
| 30 | 30 | { |
| 31 | - return function (AMQPMessage $message) { |
|
| 31 | + return function(AMQPMessage $message) { |
|
| 32 | 32 | $this->getQueueService()->handle($message); |
| 33 | 33 | |
| 34 | 34 | $message->delivery_info['channel']->basic_ack($message->delivery_info['delivery_tag']); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | ->disableOriginalConstructor() |
| 49 | 49 | ->getMock(); |
| 50 | 50 | |
| 51 | - $channelMock = $this->getMockBuilder(CmobiAMQPChannel::class) |
|
| 51 | + $channelMock = $this->getMockBuilder(CmobiAMQPChannel::class) |
|
| 52 | 52 | ->disableOriginalConstructor() |
| 53 | 53 | ->getMock(); |
| 54 | 54 | $channelMock->expects($this->any()) |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | ->disableOriginalConstructor() |
| 77 | 77 | ->getMock(); |
| 78 | 78 | |
| 79 | - $channelMock = $this->getMockBuilder(CmobiAMQPChannel::class) |
|
| 79 | + $channelMock = $this->getMockBuilder(CmobiAMQPChannel::class) |
|
| 80 | 80 | ->disableOriginalConstructor() |
| 81 | 81 | ->getMock(); |
| 82 | 82 | $channelMock->expects($this->any()) |