Skip to content

Commit c92f4c2

Browse files
committed
move check to consume method.
1 parent c3740ef commit c92f4c2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎pkg/amqp-ext/AmqpSubscriptionConsumer.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ class AmqpSubscriptionConsumer implements InteropAmqpSubscriptionConsumer
2121

2222
public function __construct(AmqpContext $context)
2323
{
24-
if (false == (version_compare(phpversion('amqp'), '1.9.1', '>=') || '1.9.1-dev' == phpversion('amqp'))) {
25-
// @see https://github.com/php-enqueue/enqueue-dev/issues/110 and https://github.com/pdezwart/php-amqp/issues/281
26-
throw new \LogicException('The AMQP extension "basic_consume" method does not work properly prior 1.9.1 version.');
27-
}
28-
2924
$this->context = $context;
3025

3126
$this->subscribers = [];
@@ -37,6 +32,11 @@ public function consume(int $timeout = 0): void
3732
throw new \LogicException('There is no subscribers. Consider calling basicConsumeSubscribe before consuming');
3833
}
3934

35+
if (false == (version_compare(phpversion('amqp'), '1.9.1', '>=') || '1.9.1-dev' == phpversion('amqp'))) {
36+
// @see https://github.com/php-enqueue/enqueue-dev/issues/110 and https://github.com/pdezwart/php-amqp/issues/281
37+
throw new \LogicException('The AMQP extension "basic_consume" method does not work properly prior 1.9.1 version.');
38+
}
39+
4040
/** @var \AMQPQueue $extQueue */
4141
$extConnection = $this->context->getExtChannel()->getConnection();
4242

0 commit comments

Comments
 (0)