@@ -42,8 +42,8 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $this->getContainer() |
| 45 | - ->get(sprintf('old_sound_rabbit_mq.%s_server', $input->getArgument('name'))) |
|
| 46 | - ->start($amount); |
|
| 45 | + ->get(sprintf('old_sound_rabbit_mq.%s_server', $input->getArgument('name'))) |
|
| 46 | + ->start($amount); |
|
| 47 | 47 | |
| 48 | 48 | return 0; |
| 49 | 49 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $amqpChannel = $this->prepareAMQPChannel(); |
| 50 | 50 | $consumer = $this->getConsumer($amqpConnection, $amqpChannel); |
| 51 | 51 | |
| 52 | - $callbackFunction = function () use ($processFlag) { |
|
| 52 | + $callbackFunction = function() use ($processFlag) { |
|
| 53 | 53 | return $processFlag; |
| 54 | 54 | }; // Create a callback function with a return value set by the data provider. |
| 55 | 55 | $consumer->setCallback($callbackFunction); |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | if ($expectedMethod) { |
| 63 | 63 | $amqpChannel->expects($this->any()) |
| 64 | 64 | ->method('basic_reject') |
| 65 | - ->will($this->returnCallback(function ($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) { |
|
| 65 | + ->will($this->returnCallback(function($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) { |
|
| 66 | 66 | Assert::assertSame($expectedMethod, 'basic_reject'); // Check if this function should be called. |
| 67 | 67 | Assert::assertSame($requeue, $expectedRequeue); // Check if the message should be requeued. |
| 68 | 68 | })); |
| 69 | 69 | |
| 70 | 70 | $amqpChannel->expects($this->any()) |
| 71 | 71 | ->method('basic_ack') |
| 72 | - ->will($this->returnCallback(function ($delivery_tag) use ($expectedMethod) { |
|
| 72 | + ->will($this->returnCallback(function($delivery_tag) use ($expectedMethod) { |
|
| 73 | 73 | Assert::assertSame($expectedMethod, 'basic_ack'); // Check if this function should be called. |
| 74 | 74 | })); |
| 75 | 75 | } else { |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | ->with(null, false, $consumer->getIdleTimeout()) |
| 175 | 175 | ->will( |
| 176 | 176 | $this->returnCallback( |
| 177 | - function () use ($amqpChannel) { |
|
| 177 | + function() use ($amqpChannel) { |
|
| 178 | 178 | /** remove an element on each loop like ... simulate an ACK */ |
| 179 | 179 | array_splice($amqpChannel->callbacks, 0, 1); |
| 180 | 180 | }) |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $amqpChannel->expects($this->exactly(1)) |
| 221 | 221 | ->method('wait') |
| 222 | 222 | ->with(null, false, $consumer->getIdleTimeout()) |
| 223 | - ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 223 | + ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 224 | 224 | // simulate time passing by moving the last activity date time |
| 225 | 225 | $consumer->setLastActivityDateTime(new \DateTime("-$waitTimeout seconds")); |
| 226 | 226 | throw new AMQPTimeoutException(); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $amqpChannel->expects($this->exactly(2)) |
| 256 | 256 | ->method('wait') |
| 257 | 257 | ->with(null, false, $consumer->getIdleTimeout()) |
| 258 | - ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 258 | + ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 259 | 259 | // simulate time passing by moving the last activity date time |
| 260 | 260 | $consumer->setLastActivityDateTime(new \DateTime("-$waitTimeout seconds")); |
| 261 | 261 | throw new AMQPTimeoutException(); |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $eventDispatcher->expects($this->at(1)) |
| 269 | 269 | ->method('dispatch') |
| 270 | 270 | ->with($this->isInstanceOf(OnIdleEvent::class), OnIdleEvent::NAME) |
| 271 | - ->willReturnCallback(function (OnIdleEvent $event, $eventName) { |
|
| 271 | + ->willReturnCallback(function(OnIdleEvent $event, $eventName) { |
|
| 272 | 272 | $event->setForceStop(false); |
| 273 | 273 | |
| 274 | 274 | return $event; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $eventDispatcher->expects($this->at(3)) |
| 278 | 278 | ->method('dispatch') |
| 279 | 279 | ->with($this->isInstanceOf(OnIdleEvent::class), OnIdleEvent::NAME) |
| 280 | - ->willReturnCallback(function (OnIdleEvent $event, $eventName) { |
|
| 280 | + ->willReturnCallback(function(OnIdleEvent $event, $eventName) { |
|
| 281 | 281 | $event->setForceStop(true); |
| 282 | 282 | |
| 283 | 283 | return $event; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | $amqpChannel->expects($this->exactly(1)) |
| 318 | 318 | ->method('wait') |
| 319 | - ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 319 | + ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 320 | 320 | // simulate time passing by moving the max execution date time |
| 321 | 321 | $consumer->setGracefulMaxExecutionDateTimeFromSecondsInTheFuture($waitTimeout * -1); |
| 322 | 322 | throw new AMQPTimeoutException(); |
@@ -383,8 +383,8 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | $amqpChannel->expects($this->exactly(2)) |
| 385 | 385 | ->method('wait') |
| 386 | - ->with(null, false, $this->LessThanOrEqual($consumer->getTimeoutWait()) ) |
|
| 387 | - ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 386 | + ->with(null, false, $this->LessThanOrEqual($consumer->getTimeoutWait())) |
|
| 387 | + ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 388 | 388 | // ensure max execution date time "counts down" |
| 389 | 389 | $consumer->setGracefulMaxExecutionDateTime( |
| 390 | 390 | $consumer->getGracefulMaxExecutionDateTime()->modify("-$waitTimeout seconds") |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $amqpChannel->expects($this->once()) |
| 426 | 426 | ->method('wait') |
| 427 | 427 | ->with(null, false, $consumer->getGracefulMaxExecutionDateTime()->diff(new \DateTime())->s) |
| 428 | - ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 428 | + ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 429 | 429 | // simulate time passing by moving the max execution date time |
| 430 | 430 | $consumer->setGracefulMaxExecutionDateTimeFromSecondsInTheFuture($waitTimeout * -1); |
| 431 | 431 | throw new AMQPTimeoutException(); |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | $amqpChannel->expects($this->once()) |
| 464 | 464 | ->method('wait') |
| 465 | 465 | ->with(null, false, 10) |
| 466 | - ->willReturnCallback(function ($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 466 | + ->willReturnCallback(function($allowedMethods, $nonBlocking, $waitTimeout) use ($consumer) { |
|
| 467 | 467 | // simulate time passing by moving the last activity date time |
| 468 | 468 | $consumer->setLastActivityDateTime(new \DateTime("-$waitTimeout seconds")); |
| 469 | 469 | throw new AMQPTimeoutException(); |
@@ -310,14 +310,14 @@ discard block |
||
| 310 | 310 | { |
| 311 | 311 | $this->amqpChannel->expects($this->any()) |
| 312 | 312 | ->method('basic_reject') |
| 313 | - ->will($this->returnCallback(function ($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) { |
|
| 313 | + ->will($this->returnCallback(function($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) { |
|
| 314 | 314 | Assert::assertSame($expectedMethod, 'basic_reject'); // Check if this function should be called. |
| 315 | 315 | Assert::assertSame($requeue, $expectedRequeue); // Check if the message should be requeued. |
| 316 | 316 | })); |
| 317 | 317 | |
| 318 | 318 | $this->amqpChannel->expects($this->any()) |
| 319 | 319 | ->method('basic_ack') |
| 320 | - ->will($this->returnCallback(function ($delivery_tag) use ($expectedMethod) { |
|
| 320 | + ->will($this->returnCallback(function($delivery_tag) use ($expectedMethod) { |
|
| 321 | 321 | Assert::assertSame($expectedMethod, 'basic_ack'); // Check if this function should be called. |
| 322 | 322 | })); |
| 323 | 323 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | private function prepareCallback(?int $processFlag) |
| 331 | 331 | { |
| 332 | - return function ($msg) use ($processFlag) { |
|
| 332 | + return function($msg) use ($processFlag) { |
|
| 333 | 333 | return $processFlag; |
| 334 | 334 | }; |
| 335 | 335 | } |
@@ -23,19 +23,19 @@ discard block |
||
| 23 | 23 | $this->assertInstanceOf('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection', $instance); |
| 24 | 24 | $this->assertEquals(array( |
| 25 | 25 | 'localhost', // host |
| 26 | - 5672, // port |
|
| 27 | - 'guest', // user |
|
| 28 | - 'guest', // password |
|
| 29 | - '/', // vhost |
|
| 30 | - false, // insist |
|
| 31 | - "AMQPLAIN", // login method |
|
| 32 | - null, // login response |
|
| 33 | - "en_US", // locale |
|
| 34 | - 3, // connection timeout |
|
| 35 | - 3, // read write timeout |
|
| 36 | - null, // context |
|
| 37 | - false, // keepalive |
|
| 38 | - 0, // heartbeat |
|
| 26 | + 5672, // port |
|
| 27 | + 'guest', // user |
|
| 28 | + 'guest', // password |
|
| 29 | + '/', // vhost |
|
| 30 | + false, // insist |
|
| 31 | + "AMQPLAIN", // login method |
|
| 32 | + null, // login response |
|
| 33 | + "en_US", // locale |
|
| 34 | + 3, // connection timeout |
|
| 35 | + 3, // read write timeout |
|
| 36 | + null, // context |
|
| 37 | + false, // keepalive |
|
| 38 | + 0, // heartbeat |
|
| 39 | 39 | ), $instance->constructParams); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -51,18 +51,18 @@ discard block |
||
| 51 | 51 | $this->assertInstanceOf('PhpAmqpLib\Connection\AMQPSocketConnection', $instance); |
| 52 | 52 | $this->assertEquals(array( |
| 53 | 53 | 'localhost', // host |
| 54 | - 5672, // port |
|
| 55 | - 'guest', // user |
|
| 56 | - 'guest', // password |
|
| 57 | - '/', // vhost |
|
| 58 | - false, // insist |
|
| 59 | - "AMQPLAIN", // login method |
|
| 60 | - null, // login response |
|
| 61 | - "en_US", // locale |
|
| 62 | - 3, // read_timeout |
|
| 63 | - false, // keepalive |
|
| 64 | - 3, // write_timeout |
|
| 65 | - 0, // heartbeat |
|
| 54 | + 5672, // port |
|
| 55 | + 'guest', // user |
|
| 56 | + 'guest', // password |
|
| 57 | + '/', // vhost |
|
| 58 | + false, // insist |
|
| 59 | + "AMQPLAIN", // login method |
|
| 60 | + null, // login response |
|
| 61 | + "en_US", // locale |
|
| 62 | + 3, // read_timeout |
|
| 63 | + false, // keepalive |
|
| 64 | + 3, // write_timeout |
|
| 65 | + 0, // heartbeat |
|
| 66 | 66 | ), $instance->constructParams); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -81,18 +81,18 @@ discard block |
||
| 81 | 81 | $this->assertInstanceOf('PhpAmqpLib\Connection\AMQPSocketConnection', $instance); |
| 82 | 82 | $this->assertEquals(array( |
| 83 | 83 | 'localhost', // host |
| 84 | - 5672, // port |
|
| 85 | - 'guest', // user |
|
| 86 | - 'guest', // password |
|
| 87 | - '/', // vhost |
|
| 88 | - false, // insist |
|
| 89 | - "AMQPLAIN", // login method |
|
| 90 | - null, // login response |
|
| 91 | - "en_US", // locale |
|
| 92 | - 31, // read_timeout |
|
| 93 | - false, // keepalive |
|
| 94 | - 32, // write_timeout |
|
| 95 | - 0, // heartbeat |
|
| 84 | + 5672, // port |
|
| 85 | + 'guest', // user |
|
| 86 | + 'guest', // password |
|
| 87 | + '/', // vhost |
|
| 88 | + false, // insist |
|
| 89 | + "AMQPLAIN", // login method |
|
| 90 | + null, // login response |
|
| 91 | + "en_US", // locale |
|
| 92 | + 31, // read_timeout |
|
| 93 | + false, // keepalive |
|
| 94 | + 32, // write_timeout |
|
| 95 | + 0, // heartbeat |
|
| 96 | 96 | ), $instance->constructParams); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -113,20 +113,20 @@ discard block |
||
| 113 | 113 | $instance = $factory->createConnection(); |
| 114 | 114 | $this->assertInstanceOf('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection', $instance); |
| 115 | 115 | $this->assertEquals(array( |
| 116 | - 'foo_host', // host |
|
| 117 | - 123, // port |
|
| 118 | - 'foo_user', // user |
|
| 116 | + 'foo_host', // host |
|
| 117 | + 123, // port |
|
| 118 | + 'foo_user', // user |
|
| 119 | 119 | 'foo_password', // password |
| 120 | - '/vhost', // vhost |
|
| 121 | - false, // insist |
|
| 122 | - "AMQPLAIN", // login method |
|
| 123 | - null, // login response |
|
| 124 | - "en_US", // locale |
|
| 125 | - 3, // connection timeout |
|
| 126 | - 3, // read write timeout |
|
| 127 | - null, // context |
|
| 128 | - false, // keepalive |
|
| 129 | - 0, // heartbeat |
|
| 120 | + '/vhost', // vhost |
|
| 121 | + false, // insist |
|
| 122 | + "AMQPLAIN", // login method |
|
| 123 | + null, // login response |
|
| 124 | + "en_US", // locale |
|
| 125 | + 3, // connection timeout |
|
| 126 | + 3, // read write timeout |
|
| 127 | + null, // context |
|
| 128 | + false, // keepalive |
|
| 129 | + 0, // heartbeat |
|
| 130 | 130 | ), $instance->constructParams); |
| 131 | 131 | } |
| 132 | 132 | |
@@ -148,20 +148,20 @@ discard block |
||
| 148 | 148 | $instance = $factory->createConnection(); |
| 149 | 149 | $this->assertInstanceOf('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection', $instance); |
| 150 | 150 | $this->assertEquals(array( |
| 151 | - 'bar_host', // host |
|
| 152 | - 321, // port |
|
| 153 | - 'bar_user', // user |
|
| 151 | + 'bar_host', // host |
|
| 152 | + 321, // port |
|
| 153 | + 'bar_user', // user |
|
| 154 | 154 | 'bar_password', // password |
| 155 | - 'whost', // vhost |
|
| 156 | - false, // insist |
|
| 157 | - "AMQPLAIN", // login method |
|
| 158 | - null, // login response |
|
| 159 | - "en_US", // locale |
|
| 160 | - 6, // connection timeout |
|
| 161 | - 6, // read write timeout |
|
| 162 | - null, // context |
|
| 163 | - true, // keepalive |
|
| 164 | - 0, // heartbeat |
|
| 155 | + 'whost', // vhost |
|
| 156 | + false, // insist |
|
| 157 | + "AMQPLAIN", // login method |
|
| 158 | + null, // login response |
|
| 159 | + "en_US", // locale |
|
| 160 | + 6, // connection timeout |
|
| 161 | + 6, // read write timeout |
|
| 162 | + null, // context |
|
| 163 | + true, // keepalive |
|
| 164 | + 0, // heartbeat |
|
| 165 | 165 | ), $instance->constructParams); |
| 166 | 166 | } |
| 167 | 167 | |
@@ -178,20 +178,20 @@ discard block |
||
| 178 | 178 | $instance = $factory->createConnection(); |
| 179 | 179 | $this->assertInstanceOf('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection', $instance); |
| 180 | 180 | $this->assertEquals(array( |
| 181 | - 'hoast', // host |
|
| 182 | - 10000, // port |
|
| 183 | - 'usera', // user |
|
| 184 | - 'apass', // password |
|
| 185 | - 'v/host', // vhost |
|
| 186 | - false, // insist |
|
| 187 | - "AMQPLAIN", // login method |
|
| 188 | - null, // login response |
|
| 189 | - "en_US", // locale |
|
| 190 | - 6, // connection timeout |
|
| 191 | - 6, // read write timeout |
|
| 192 | - null, // context |
|
| 193 | - true, // keepalive |
|
| 194 | - 0, // heartbeat |
|
| 181 | + 'hoast', // host |
|
| 182 | + 10000, // port |
|
| 183 | + 'usera', // user |
|
| 184 | + 'apass', // password |
|
| 185 | + 'v/host', // vhost |
|
| 186 | + false, // insist |
|
| 187 | + "AMQPLAIN", // login method |
|
| 188 | + null, // login response |
|
| 189 | + "en_US", // locale |
|
| 190 | + 6, // connection timeout |
|
| 191 | + 6, // read write timeout |
|
| 192 | + null, // context |
|
| 193 | + true, // keepalive |
|
| 194 | + 0, // heartbeat |
|
| 195 | 195 | ), $instance->constructParams); |
| 196 | 196 | } |
| 197 | 197 | |
@@ -208,20 +208,20 @@ discard block |
||
| 208 | 208 | $instance = $factory->createConnection(); |
| 209 | 209 | $this->assertInstanceOf('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection', $instance); |
| 210 | 210 | $this->assertEquals(array( |
| 211 | - 'host', // host |
|
| 212 | - 321, // port |
|
| 213 | - 'user', // user |
|
| 214 | - 'pass', // password |
|
| 215 | - '', // vhost |
|
| 216 | - false, // insist |
|
| 211 | + 'host', // host |
|
| 212 | + 321, // port |
|
| 213 | + 'user', // user |
|
| 214 | + 'pass', // password |
|
| 215 | + '', // vhost |
|
| 216 | + false, // insist |
|
| 217 | 217 | "AMQPLAIN", // login method |
| 218 | - null, // login response |
|
| 219 | - "en_US", // locale |
|
| 220 | - 6, // connection timeout |
|
| 221 | - 6, // read write timeout |
|
| 222 | - null, // context |
|
| 223 | - true, // keepalive |
|
| 224 | - 0, // heartbeat |
|
| 218 | + null, // login response |
|
| 219 | + "en_US", // locale |
|
| 220 | + 6, // connection timeout |
|
| 221 | + 6, // read write timeout |
|
| 222 | + null, // context |
|
| 223 | + true, // keepalive |
|
| 224 | + 0, // heartbeat |
|
| 225 | 225 | ), $instance->constructParams); |
| 226 | 226 | } |
| 227 | 227 | |
@@ -254,19 +254,19 @@ discard block |
||
| 254 | 254 | $this->assertEquals(array('ssl' => array('verify_peer' => false)), $options); |
| 255 | 255 | $this->assertEquals(array( |
| 256 | 256 | 'ssl_host', // host |
| 257 | - 123, // port |
|
| 257 | + 123, // port |
|
| 258 | 258 | 'ssl_user', // user |
| 259 | 259 | 'ssl_password', // password |
| 260 | - '/ssl', // vhost |
|
| 261 | - false, // insist |
|
| 262 | - "AMQPLAIN", // login method |
|
| 263 | - null, // login response |
|
| 264 | - "en_US", // locale |
|
| 265 | - 3, // connection timeout |
|
| 266 | - 3, // read write timeout |
|
| 267 | - null, // context checked earlier |
|
| 268 | - false, // keepalive |
|
| 269 | - 0, // heartbeat |
|
| 260 | + '/ssl', // vhost |
|
| 261 | + false, // insist |
|
| 262 | + "AMQPLAIN", // login method |
|
| 263 | + null, // login response |
|
| 264 | + "en_US", // locale |
|
| 265 | + 3, // connection timeout |
|
| 266 | + 3, // read write timeout |
|
| 267 | + null, // context checked earlier |
|
| 268 | + false, // keepalive |
|
| 269 | + 0, // heartbeat |
|
| 270 | 270 | ), $instance->constructParams); |
| 271 | 271 | } |
| 272 | 272 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | ->method('getConnectionParameters') |
| 278 | 278 | ->will($this->returnValue( |
| 279 | 279 | array( |
| 280 | - 'constructor_args' => array(1,2,3,4) |
|
| 280 | + 'constructor_args' => array(1, 2, 3, 4) |
|
| 281 | 281 | ) |
| 282 | 282 | )); |
| 283 | 283 | $factory = new AMQPConnectionFactory( |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | /** @var AMQPConnection $instance */ |
| 290 | 290 | $instance = $factory->createConnection(); |
| 291 | 291 | $this->assertInstanceOf('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection', $instance); |
| 292 | - $this->assertEquals(array(1,2,3,4), $instance->constructParams); |
|
| 292 | + $this->assertEquals(array(1, 2, 3, 4), $instance->constructParams); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | public function testConnectionsParametersProvider(): void |
@@ -316,20 +316,20 @@ discard block |
||
| 316 | 316 | $instance = $factory->createConnection(); |
| 317 | 317 | $this->assertInstanceOf('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection', $instance); |
| 318 | 318 | $this->assertEquals(array( |
| 319 | - '1.2.3.4', // host |
|
| 320 | - 5678, // port |
|
| 321 | - 'admin', // user |
|
| 322 | - 'admin', // password |
|
| 323 | - 'foo', // vhost |
|
| 324 | - false, // insist |
|
| 325 | - "AMQPLAIN", // login method |
|
| 326 | - null, // login response |
|
| 327 | - "en_US", // locale |
|
| 328 | - 3, // connection timeout |
|
| 329 | - 3, // read write timeout |
|
| 330 | - null, // context |
|
| 331 | - false, // keepalive |
|
| 332 | - 0, // heartbeat |
|
| 319 | + '1.2.3.4', // host |
|
| 320 | + 5678, // port |
|
| 321 | + 'admin', // user |
|
| 322 | + 'admin', // password |
|
| 323 | + 'foo', // vhost |
|
| 324 | + false, // insist |
|
| 325 | + "AMQPLAIN", // login method |
|
| 326 | + null, // login response |
|
| 327 | + "en_US", // locale |
|
| 328 | + 3, // connection timeout |
|
| 329 | + 3, // read write timeout |
|
| 330 | + null, // context |
|
| 331 | + false, // keepalive |
|
| 332 | + 0, // heartbeat |
|
| 333 | 333 | ), $instance->constructParams); |
| 334 | 334 | } |
| 335 | 335 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | //PHP 5.3 Compliant |
| 62 | 62 | $currentObject = $this; |
| 63 | 63 | |
| 64 | - $this->getChannel()->basic_consume($name, $this->getQueueConsumerTag($name), false, false, false, false, function (AMQPMessage $msg) use($currentObject, $name) { |
|
| 64 | + $this->getChannel()->basic_consume($name, $this->getQueueConsumerTag($name), false, false, false, false, function(AMQPMessage $msg) use($currentObject, $name) { |
|
| 65 | 65 | $currentObject->processQueueMessage($name, $msg); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | protected function queueDeclare(): void |
| 71 | 71 | { |
| 72 | 72 | foreach ($this->queues as $name => $options) { |
| 73 | - list($queueName, ,) = $this->getChannel()->queue_declare( |
|
| 73 | + list($queueName,,) = $this->getChannel()->queue_declare( |
|
| 74 | 74 | $name, $options['passive'], |
| 75 | 75 | $options['durable'], $options['exclusive'], |
| 76 | 76 | $options['auto_delete'], $options['nowait'], |
@@ -5,21 +5,21 @@ |
||
| 5 | 5 | class AmqpPartsHolder |
| 6 | 6 | { |
| 7 | 7 | /** @var array */ |
| 8 | - protected $parts; |
|
| 8 | + protected $parts; |
|
| 9 | 9 | |
| 10 | - public function __construct() |
|
| 11 | - { |
|
| 12 | - $this->parts = array(); |
|
| 13 | - } |
|
| 10 | + public function __construct() |
|
| 11 | + { |
|
| 12 | + $this->parts = array(); |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - public function addPart(string $type, BaseAmqp $part): void |
|
| 16 | - { |
|
| 17 | - $this->parts[$type][] = $part; |
|
| 18 | - } |
|
| 15 | + public function addPart(string $type, BaseAmqp $part): void |
|
| 16 | + { |
|
| 17 | + $this->parts[$type][] = $part; |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - public function getParts(string $type): array |
|
| 21 | - { |
|
| 20 | + public function getParts(string $type): array |
|
| 21 | + { |
|
| 22 | 22 | $type = (string) $type; |
| 23 | - return isset($this->parts[$type]) ? $this->parts[$type] : array(); |
|
| 24 | - } |
|
| 23 | + return isset($this->parts[$type]) ? $this->parts[$type] : array(); |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | private function addMessage(AMQPMessage $message): void |
| 264 | 264 | { |
| 265 | 265 | $this->batchCounter++; |
| 266 | - $this->messages[(int)$message->delivery_info['delivery_tag']] = $message; |
|
| 266 | + $this->messages[(int) $message->delivery_info['delivery_tag']] = $message; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | private function getMessage(int $deliveryTag): ?AMQPMessage |
@@ -34,12 +34,12 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | protected $arguments; |
| 36 | 36 | |
| 37 | - public function getExchange(): string |
|
| 37 | + public function getExchange(): string |
|
| 38 | 38 | { |
| 39 | 39 | return $this->exchange; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function setExchange(string $exchange): void |
|
| 42 | + public function setExchange(string $exchange): void |
|
| 43 | 43 | { |
| 44 | 44 | $this->exchange = $exchange; |
| 45 | 45 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | public function initServer(string $name): void |
| 13 | 13 | { |
| 14 | 14 | $this->setExchangeOptions(array('name' => $name, 'type' => 'direct')); |
| 15 | - $this->setQueueOptions(array('name' => $name . '-queue')); |
|
| 15 | + $this->setQueueOptions(array('name' => $name.'-queue')); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | public function processMessage(AMQPMessage $msg): void |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $this->consumed++; |
| 26 | 26 | $this->maybeStopConsumer(); |
| 27 | 27 | } catch (\Exception $e) { |
| 28 | - $this->sendReply('error: ' . $e->getMessage(), $msg->get('reply_to'), $msg->get('correlation_id')); |
|
| 28 | + $this->sendReply('error: '.$e->getMessage(), $msg->get('reply_to'), $msg->get('correlation_id')); |
|
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |