@@ -20,6 +20,10 @@ discard block |
||
| 20 | 20 | private $correlationId; |
| 21 | 21 | private $callbackQueue; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $queueName |
|
| 25 | + * @param string $fromName |
|
| 26 | + */ |
|
| 23 | 27 | public function __construct($queueName, ConnectionManager $manager, $fromName) |
| 24 | 28 | { |
| 25 | 29 | $this->queueName = $queueName; |
@@ -55,7 +59,7 @@ discard block |
||
| 55 | 59 | } |
| 56 | 60 | |
| 57 | 61 | /** |
| 58 | - * @param $data |
|
| 62 | + * @param string $data |
|
| 59 | 63 | * @param int $expire |
| 60 | 64 | * @param int $priority |
| 61 | 65 | * @throws QueueNotFoundException |
@@ -148,7 +152,7 @@ discard block |
||
| 148 | 152 | /** |
| 149 | 153 | * @todo unecessary method set, its only exists to run tests whitout stay jailed in infinite while waiting response. |
| 150 | 154 | * |
| 151 | - * @param $content |
|
| 155 | + * @param string $content |
|
| 152 | 156 | */ |
| 153 | 157 | public function setResponse($content) |
| 154 | 158 | { |
@@ -178,7 +182,7 @@ discard block |
||
| 178 | 182 | } |
| 179 | 183 | |
| 180 | 184 | /** |
| 181 | - * @return string |
|
| 185 | + * @return boolean |
|
| 182 | 186 | */ |
| 183 | 187 | public function getExchange() |
| 184 | 188 | { |
@@ -186,7 +190,7 @@ discard block |
||
| 186 | 190 | } |
| 187 | 191 | |
| 188 | 192 | /** |
| 189 | - * @return string |
|
| 193 | + * @return boolean |
|
| 190 | 194 | */ |
| 191 | 195 | public function getExchangeType() |
| 192 | 196 | { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $this->response = null; |
| 67 | 67 | $this->refreshChannel(); |
| 68 | 68 | |
| 69 | - if (! $this->queueHasExists()) { |
|
| 69 | + if (!$this->queueHasExists()) { |
|
| 70 | 70 | throw new QueueNotFoundException("Queue $this->queueName not declared."); |
| 71 | 71 | } |
| 72 | 72 | $this->correlationId = $this->generateCorrelationId(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | [$this, 'onResponse'] |
| 92 | 92 | ); |
| 93 | 93 | $msg = new CmobiAMQPMessage( |
| 94 | - (string) $data, |
|
| 94 | + (string)$data, |
|
| 95 | 95 | [ |
| 96 | 96 | 'correlation_id' => $this->correlationId, |
| 97 | 97 | 'reply_to' => $this->callbackQueue, |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | ); |
| 101 | 101 | $this->getChannel()->basic_publish($msg, '', $this->getQueueName()); |
| 102 | 102 | |
| 103 | - while (! $this->response) { |
|
| 103 | + while (!$this->response) { |
|
| 104 | 104 | $this->getChannel()->wait(null, 0, ($expire / 1000)); |
| 105 | 105 | } |
| 106 | 106 | $this->getChannel()->close(); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | /** @return string */ |
| 167 | 167 | public function generateCorrelationId() |
| 168 | 168 | { |
| 169 | - return uniqid($this->getQueueName()) . Uuid::uuid4()->toString() . microtime(); |
|
| 169 | + return uniqid($this->getQueueName()).Uuid::uuid4()->toString().microtime(); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -17,6 +17,10 @@ |
||
| 17 | 17 | private $exchange; |
| 18 | 18 | private $exchangeType; |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $exchange |
|
| 22 | + * @param string $fromName |
|
| 23 | + */ |
|
| 20 | 24 | public function __construct( |
| 21 | 25 | $exchange, |
| 22 | 26 | $exchangeType = ExchangeType::FANOUT, |
@@ -16,6 +16,10 @@ discard block |
||
| 16 | 16 | private $fromName; |
| 17 | 17 | private $queueName; |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param string $queueName |
|
| 21 | + * @param string $fromName |
|
| 22 | + */ |
|
| 19 | 23 | public function __construct($queueName, ConnectionManager $manager, $fromName) |
| 20 | 24 | { |
| 21 | 25 | $this->queueName = $queueName; |
@@ -107,7 +111,7 @@ discard block |
||
| 107 | 111 | } |
| 108 | 112 | |
| 109 | 113 | /** |
| 110 | - * @return string |
|
| 114 | + * @return boolean |
|
| 111 | 115 | */ |
| 112 | 116 | public function getExchange() |
| 113 | 117 | { |
@@ -115,7 +119,7 @@ discard block |
||
| 115 | 119 | } |
| 116 | 120 | |
| 117 | 121 | /** |
| 118 | - * @return string |
|
| 122 | + * @return boolean |
|
| 119 | 123 | */ |
| 120 | 124 | public function getExchangeType() |
| 121 | 125 | { |