@@ -39,12 +39,12 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $msg = new AMQPMessage($msgBody, array('content_type' => 'text/plain', |
42 | - 'reply_to' => $this->directReplyTo |
|
42 | + 'reply_to' => $this->directReplyTo |
|
43 | 43 | ? 'amq.rabbitmq.reply-to' // On direct reply-to mode, use predefined queue name |
44 | 44 | : $this->getQueueName(), |
45 | - 'delivery_mode' => 1, // non durable |
|
46 | - 'expiration' => $expiration*1000, |
|
47 | - 'correlation_id' => $requestId)); |
|
45 | + 'delivery_mode' => 1, // non durable |
|
46 | + 'expiration' => $expiration*1000, |
|
47 | + 'correlation_id' => $requestId)); |
|
48 | 48 | |
49 | 49 | $this->getChannel()->basic_publish($msg, $server, $routingKey); |
50 | 50 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | ? 'amq.rabbitmq.reply-to' // On direct reply-to mode, use predefined queue name |
52 | 52 | : $this->getQueueName(), |
53 | 53 | 'delivery_mode' => 1, // non durable |
54 | - 'expiration' => $expiration*1000, |
|
54 | + 'expiration' => $expiration * 1000, |
|
55 | 55 | 'correlation_id' => $requestId)); |
56 | 56 | |
57 | 57 | $this->getChannel()->basic_publish($msg, $server, $routingKey); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | protected function getQueueName(): ?string |
103 | 103 | { |
104 | 104 | if (null === $this->queueName) { |
105 | - list($this->queueName, ,) = $this->getChannel()->queue_declare("", false, false, true, false); |
|
105 | + list($this->queueName,,) = $this->getChannel()->queue_declare("", false, false, true, false); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return $this->queueName; |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $msg->set('application_headers', $headersTable); |
54 | 54 | } |
55 | 55 | |
56 | - $this->getChannel()->basic_publish($msg, $this->exchangeOptions['name'], (string)$routingKey); |
|
56 | + $this->getChannel()->basic_publish($msg, $this->exchangeOptions['name'], (string) $routingKey); |
|
57 | 57 | $this->logger->debug('AMQP message published', array( |
58 | 58 | 'amqp' => array( |
59 | 59 | 'body' => $msgBody, |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use OldSound\RabbitMqBundle\Provider\QueueOptionsProviderInterface; |
6 | 6 | |
7 | -class DynamicConsumer extends Consumer{ |
|
7 | +class DynamicConsumer extends Consumer { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Queue provider |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $partsHolder = $this->getContainer()->get('old_sound_rabbit_mq.parts_holder'); |
30 | 30 | |
31 | 31 | foreach (array('base_amqp', 'binding') as $key) { |
32 | - foreach ($partsHolder->getParts('old_sound_rabbit_mq.' . $key) as $baseAmqp) { |
|
32 | + foreach ($partsHolder->getParts('old_sound_rabbit_mq.'.$key) as $baseAmqp) { |
|
33 | 33 | if ($baseAmqp instanceof DynamicConsumer) { |
34 | 34 | continue; |
35 | 35 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | - return (int)$numerical; |
|
62 | + return (int) $numerical; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $serializer->expects($this->once())->method('deserialize')->with('message', 'json', null); |
27 | 27 | $client->initClient(true); |
28 | 28 | $client->setUnserializer(function($data) use ($serializer) { |
29 | - $serializer->deserialize($data, 'json',''); |
|
29 | + $serializer->deserialize($data, 'json', ''); |
|
30 | 30 | }); |
31 | 31 | $client->processMessage($message); |
32 | 32 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | ->setConstructorArgs(array($expectedNotify)) |
46 | 46 | ->getMock(); |
47 | 47 | $notified = false; |
48 | - $client->notify(function ($message) use (&$notified) { |
|
48 | + $client->notify(function($message) use (&$notified) { |
|
49 | 49 | $notified = $message; |
50 | 50 | }); |
51 | 51 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | ->disableOriginalConstructor() |
17 | 17 | ->getMock(); |
18 | 18 | $message = $this->getMockBuilder('\PhpAmqpLib\Message\AMQPMessage') |
19 | - ->setMethods( array('get')) |
|
19 | + ->setMethods(array('get')) |
|
20 | 20 | ->getMock(); |
21 | 21 | $message->delivery_info = array( |
22 | 22 | 'channel' => $this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel') |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $key = 'example_key'; |
47 | 47 | $ch->expects($this->once()) |
48 | 48 | ->method('queue_bind') |
49 | - ->will($this->returnCallback(function ($d, $s, $k, $n, $a) use ($destination, $source, $key) { |
|
49 | + ->will($this->returnCallback(function($d, $s, $k, $n, $a) use ($destination, $source, $key) { |
|
50 | 50 | Assert::assertSame($destination, $d); |
51 | 51 | Assert::assertSame($source, $s); |
52 | 52 | Assert::assertSame($key, $k); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $key = 'example_key'; |
72 | 72 | $ch->expects($this->once()) |
73 | 73 | ->method('exchange_bind') |
74 | - ->will($this->returnCallback(function ($d, $s, $k, $n, $a) use ($destination, $source, $key) { |
|
74 | + ->will($this->returnCallback(function($d, $s, $k, $n, $a) use ($destination, $source, $key) { |
|
75 | 75 | Assert::assertSame($destination, $d); |
76 | 76 | Assert::assertSame($source, $s); |
77 | 77 | Assert::assertSame($key, $k); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $this->container = $container; |
39 | 39 | |
40 | - $loader = new XmlFileLoader($this->container, new FileLocator(array(__DIR__ . '/../Resources/config'))); |
|
40 | + $loader = new XmlFileLoader($this->container, new FileLocator(array(__DIR__.'/../Resources/config'))); |
|
41 | 41 | $loader->load('rabbitmq.xml'); |
42 | 42 | |
43 | 43 | $configuration = $this->getConfiguration($configs, $container); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | if (empty($consumer['queues']) && empty($consumer['queues_provider'])) { |
252 | 252 | throw new InvalidConfigurationException( |
253 | - "Error on loading $key multiple consumer. " . |
|
253 | + "Error on loading $key multiple consumer. ". |
|
254 | 254 | "Either 'queues' or 'queues_provider' parameters should be defined." |
255 | 255 | ); |
256 | 256 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | if (empty($consumer['queue_options_provider'])) { |
332 | 332 | throw new InvalidConfigurationException( |
333 | - "Error on loading $key dynamic consumer. " . |
|
333 | + "Error on loading $key dynamic consumer. ". |
|
334 | 334 | "'queue_provider' parameter should be defined." |
335 | 335 | ); |
336 | 336 | } |