@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Cmobi\RabbitmqBundle\DependencyInjection; |
4 | 4 | |
5 | -use Cmobi\RabbitmqBundle\DependencyInjection\Compiler\ConfigCachePass; |
|
6 | 5 | use Cmobi\RabbitmqBundle\DependencyInjection\Compiler\LogDispatcherPass; |
7 | 6 | use Symfony\Component\Config\FileLocator; |
8 | 7 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
@@ -130,7 +130,7 @@ |
||
130 | 130 | |
131 | 131 | /** |
132 | 132 | * @param string $msg |
133 | - * @param null $correlationId |
|
133 | + * @param string $correlationId |
|
134 | 134 | * @return CmobiAMQPMessage |
135 | 135 | */ |
136 | 136 | protected function getCmobiAMQPMessage($msg = '', $correlationId = null) |
@@ -17,6 +17,9 @@ |
||
17 | 17 | private $exchange; |
18 | 18 | private $exchangeType; |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $exchange |
|
22 | + */ |
|
20 | 23 | public function __construct( |
21 | 24 | $exchange, |
22 | 25 | $exchangeType = ExchangeType::FANOUT, |
@@ -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(); |
@@ -17,6 +17,9 @@ discard block |
||
17 | 17 | private $logger; |
18 | 18 | private $parameters; |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $exchangeName |
|
22 | + */ |
|
20 | 23 | public function __construct( |
21 | 24 | $exchangeName, |
22 | 25 | $exchangeType = ExchangeType::FANOUT, |
@@ -34,7 +37,7 @@ discard block |
||
34 | 37 | } |
35 | 38 | |
36 | 39 | /** |
37 | - * @param $queueName |
|
40 | + * @param string $queueName |
|
38 | 41 | * @param QueueServiceInterface $queueService |
39 | 42 | * |
40 | 43 | * @return Queue |
@@ -18,6 +18,9 @@ discard block |
||
18 | 18 | private $correlationId; |
19 | 19 | private $callbackQueue; |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $queueName |
|
23 | + */ |
|
21 | 24 | public function __construct($queueName, ConnectionManager $manager, $fromName = '') |
22 | 25 | { |
23 | 26 | $this->queueName = $queueName; |
@@ -52,7 +55,7 @@ discard block |
||
52 | 55 | } |
53 | 56 | |
54 | 57 | /** |
55 | - * @param $data |
|
58 | + * @param string $data |
|
56 | 59 | * @param int $expire |
57 | 60 | * @param int $priority |
58 | 61 | */ |
@@ -118,7 +121,7 @@ discard block |
||
118 | 121 | /** |
119 | 122 | * @todo unecessary method set, its only exists to run tests whitout stay jailed in infinite while waiting response. |
120 | 123 | * |
121 | - * @param $content |
|
124 | + * @param string $content |
|
122 | 125 | */ |
123 | 126 | public function setResponse($content) |
124 | 127 | { |
@@ -148,7 +151,7 @@ discard block |
||
148 | 151 | } |
149 | 152 | |
150 | 153 | /** |
151 | - * @return string |
|
154 | + * @return boolean |
|
152 | 155 | */ |
153 | 156 | public function getExchange() |
154 | 157 | { |
@@ -156,7 +159,7 @@ discard block |
||
156 | 159 | } |
157 | 160 | |
158 | 161 | /** |
159 | - * @return string |
|
162 | + * @return boolean |
|
160 | 163 | */ |
161 | 164 | public function getExchangeType() |
162 | 165 | { |
@@ -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 | /** |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
277 | - * @return string |
|
277 | + * @return boolean |
|
278 | 278 | */ |
279 | 279 | public function getExchange() |
280 | 280 | { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
285 | - * @return string |
|
285 | + * @return boolean |
|
286 | 286 | */ |
287 | 287 | public function getType() |
288 | 288 | { |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | - * @param $queueName |
|
29 | + * @param string $queueName |
|
30 | 30 | * @param QueueServiceInterface $queueService |
31 | 31 | * |
32 | 32 | * @return Queue |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Cmobi\RabbitmqBundle\Transport\Rpc; |
4 | 4 | |
5 | -use Cmobi\RabbitmqBundle\Connection\CmobiAMQPChannel; |
|
6 | -use Cmobi\RabbitmqBundle\Connection\CmobiAMQPConnectionInterface; |
|
7 | 5 | use Cmobi\RabbitmqBundle\Connection\ConnectionManager; |
8 | 6 | use Cmobi\RabbitmqBundle\Connection\Exception\InvalidAMQPChannelException; |
9 | 7 | use Cmobi\RabbitmqBundle\Queue\Queue; |
@@ -15,6 +15,9 @@ discard block |
||
15 | 15 | private $fromName; |
16 | 16 | private $queueName; |
17 | 17 | |
18 | + /** |
|
19 | + * @param string $queueName |
|
20 | + */ |
|
18 | 21 | public function __construct($queueName, ConnectionManager $manager, $fromName = '') |
19 | 22 | { |
20 | 23 | $this->queueName = $queueName; |
@@ -87,7 +90,7 @@ discard block |
||
87 | 90 | } |
88 | 91 | |
89 | 92 | /** |
90 | - * @return string |
|
93 | + * @return boolean |
|
91 | 94 | */ |
92 | 95 | public function getExchange() |
93 | 96 | { |
@@ -95,7 +98,7 @@ discard block |
||
95 | 98 | } |
96 | 99 | |
97 | 100 | /** |
98 | - * @return string |
|
101 | + * @return boolean |
|
99 | 102 | */ |
100 | 103 | public function getExchangeType() |
101 | 104 | { |
@@ -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(); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | - * @param $queueName |
|
29 | + * @param string $queueName |
|
30 | 30 | * @param QueueServiceInterface $queueService |
31 | 31 | * |
32 | 32 | * @return Queue |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Cmobi\RabbitmqBundle\Transport\Worker; |
4 | 4 | |
5 | -use Cmobi\RabbitmqBundle\Connection\CmobiAMQPChannel; |
|
6 | -use Cmobi\RabbitmqBundle\Connection\CmobiAMQPConnectionInterface; |
|
7 | 5 | use Cmobi\RabbitmqBundle\Connection\ConnectionManager; |
8 | 6 | use Cmobi\RabbitmqBundle\Connection\Exception\InvalidAMQPChannelException; |
9 | 7 | use Cmobi\RabbitmqBundle\Queue\Queue; |