From 6a59c30b507dfb5527c8992c77da945f31850ed0 Mon Sep 17 00:00:00 2001 From: Muha Ajjan Date: Thu, 6 Feb 2025 18:25:35 +0100 Subject: [PATCH] Update the connect() method to avoid throwing warnings if queue is null If the connection is configured without a queue, and the queue is provided while performing a pushRaw(), the operation will throw a warning: ``` DEPRECATED str_ends_with(): Passing null to parameter #1 ($haystack) of type string is deprecated ``` --- src/Queue/Connectors/SqsFifoConnector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Queue/Connectors/SqsFifoConnector.php b/src/Queue/Connectors/SqsFifoConnector.php index de28266..6b58872 100644 --- a/src/Queue/Connectors/SqsFifoConnector.php +++ b/src/Queue/Connectors/SqsFifoConnector.php @@ -22,7 +22,7 @@ public function connect(array $config) { $config = $this->getDefaultConfiguration($config); - if (!Str::endsWith($config['queue'], '.fifo')) { + if (!empty($config['queue']) && !Str::endsWith($config['queue'], '.fifo')) { throw new InvalidArgumentException('FIFO queue name must end in ".fifo"'); }