Skip to content

Commit 399b190

Browse files
committed
vyuldashev#225 laravel horizon support
1 parent c930937 commit 399b190

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Queue/Connectors/RabbitMQConnector.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors;
44

5+
use Enqueue\AmqpLib\AmqpConnectionFactory as EnqueueAmqpConnectionFactory;
56
use Illuminate\Support\Arr;
67
use Interop\Amqp\AmqpContext;
78
use Illuminate\Contracts\Queue\Queue;
@@ -42,8 +43,9 @@ public function connect(array $config): Queue
4243
throw new \LogicException('The factory_class option is missing though it is required.');
4344
}
4445

45-
$factoryClass = $config['factory_class'];
46-
if (false === class_exists($factoryClass) || false === (new \ReflectionClass($factoryClass))->implementsInterface(InteropAmqpConnectionFactory::class)) {
46+
$factoryClass = Arr::get($config, 'factory_class', EnqueueAmqpConnectionFactory::class);
47+
48+
if (!class_exists($factoryClass) || !(new \ReflectionClass($factoryClass))->implementsInterface(InteropAmqpConnectionFactory::class)) {
4749
throw new \LogicException(sprintf('The factory_class option has to be valid class that implements "%s"', InteropAmqpConnectionFactory::class));
4850
}
4951

0 commit comments

Comments
 (0)