@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function load(array $configs, ContainerBuilder $container) |
| 19 | 19 | { |
| 20 | - $fileLocator = new FileLocator(__DIR__ . '/../Resources/config'); |
|
| 20 | + $fileLocator = new FileLocator(__DIR__.'/../Resources/config'); |
|
| 21 | 21 | $loader = new YamlFileLoader($container, $fileLocator); |
| 22 | 22 | $loader->load('rabbitmq.yml'); |
| 23 | 23 | |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function registerContainerConfiguration(LoaderInterface $loader) |
| 17 | 17 | { |
| 18 | - $loader->load(__DIR__ . '/config/config.yml'); |
|
| 18 | + $loader->load(__DIR__.'/config/config.yml'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -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']); |