diff --git a/pkg/enqueue/Consumption/QueueConsumer.php b/pkg/enqueue/Consumption/QueueConsumer.php index c41028b91..58209db8d 100644 --- a/pkg/enqueue/Consumption/QueueConsumer.php +++ b/pkg/enqueue/Consumption/QueueConsumer.php @@ -346,10 +346,18 @@ public function consume(ExtensionInterface $runtimeExtension = null) /** * @param bool $enableSubscriptionConsumer + * @throws \Enqueue\Consumption\Exception\InvalidArgumentException */ - public function enableSubscriptionConsumer(bool $enableSubscriptionConsumer) + public function enableSubscriptionConsumer($enableSubscriptionConsumer) { - $this->enableSubscriptionConsumer = $enableSubscriptionConsumer; + if (!is_bool($enableSubscriptionConsumer)) { + throw new InvalidArgumentException( + sprintf( + 'The argument must be a boolean but got %s.', + is_object($enableSubscriptionConsumer) ? get_class($enableSubscriptionConsumer) : gettype($enableSubscriptionConsumer) + ) + ); + } } /**