@@ -101,7 +101,6 @@ public function pushRaw($payload, $queue = null, array $options = [])
101101 {
102102 try {
103103 $ queue = $ this ->getQueueName ($ queue );
104- $ this ->declareQueue ($ queue );
105104 if (isset ($ options ['delay ' ]) && $ options ['delay ' ] > 0 ) {
106105 list ($ queue , $ exchange ) = $ this ->declareDelayedQueue ($ queue , $ options ['delay ' ]);
107106 } else {
@@ -113,7 +112,7 @@ public function pushRaw($payload, $queue = null, array $options = [])
113112 'delivery_mode ' => 2 ,
114113 ];
115114
116- if (isset ( $ this ->retryAfter ) === true ) {
115+ if ($ this ->retryAfter !== null ) {
117116 $ headers ['application_headers ' ] = [self ::ATTEMPT_COUNT_HEADERS_KEY => ['I ' , $ this ->retryAfter ]];
118117 }
119118
@@ -201,7 +200,7 @@ private function declareQueue($name)
201200 $ name = $ this ->getQueueName ($ name );
202201 $ exchange = $ this ->configExchange ['name ' ] ?: $ name ;
203202
204- if ($ this ->declareExchange && !in_array ($ exchange , $ this ->declaredExchanges )) {
203+ if ($ this ->declareExchange && !in_array ($ exchange , $ this ->declaredExchanges , true )) {
205204 // declare exchange
206205 $ this ->channel ->exchange_declare (
207206 $ exchange ,
@@ -214,7 +213,7 @@ private function declareQueue($name)
214213 $ this ->declaredExchanges [] = $ exchange ;
215214 }
216215
217- if ($ this ->declareBindQueue && !in_array ($ name , $ this ->declaredQueues )) {
216+ if ($ this ->declareBindQueue && !in_array ($ name , $ this ->declaredQueues , true )) {
218217 // declare queue
219218 $ this ->channel ->queue_declare (
220219 $ name ,
@@ -237,7 +236,7 @@ private function declareQueue($name)
237236 * @param string $destination
238237 * @param DateTime|int $delay
239238 *
240- * @return string
239+ * @return array
241240 */
242241 private function declareDelayedQueue ($ destination , $ delay )
243242 {
@@ -248,7 +247,7 @@ private function declareDelayedQueue($destination, $delay)
248247 $ exchange = $ this ->configExchange ['name ' ] ?: $ destination ;
249248
250249 // declare exchange
251- if (!in_array ($ exchange , $ this ->declaredExchanges )) {
250+ if (!in_array ($ exchange , $ this ->declaredExchanges , true )) {
252251 $ this ->channel ->exchange_declare (
253252 $ exchange ,
254253 $ this ->configExchange ['type ' ],
@@ -259,7 +258,7 @@ private function declareDelayedQueue($destination, $delay)
259258 }
260259
261260 // declare queue
262- if (!in_array ($ name , $ this ->declaredQueues )) {
261+ if (!in_array ($ name , $ this ->declaredQueues , true )) {
263262 $ this ->channel ->queue_declare (
264263 $ name ,
265264 $ this ->configQueue ['passive ' ],
@@ -312,7 +311,7 @@ public function setCorrelationId($id)
312311 */
313312 public function getCorrelationId ()
314313 {
315- return $ this ->correlationId ?: uniqid ();
314+ return $ this ->correlationId ?: uniqid ('' , true );
316315 }
317316
318317 /**
0 commit comments