File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -346,10 +346,18 @@ public function consume(ExtensionInterface $runtimeExtension = null)
346
346
347
347
/**
348
348
* @param bool $enableSubscriptionConsumer
349
+ * @throws \Enqueue\Consumption\Exception\InvalidArgumentException
349
350
*/
350
- public function enableSubscriptionConsumer (bool $ enableSubscriptionConsumer )
351
+ public function enableSubscriptionConsumer ($ enableSubscriptionConsumer )
351
352
{
352
- $ this ->enableSubscriptionConsumer = $ enableSubscriptionConsumer ;
353
+ if (!is_bool ($ enableSubscriptionConsumer )) {
354
+ throw new InvalidArgumentException (
355
+ sprintf (
356
+ 'The argument must be a boolean but got %s. ' ,
357
+ is_object ($ enableSubscriptionConsumer ) ? get_class ($ enableSubscriptionConsumer ) : gettype ($ enableSubscriptionConsumer )
358
+ )
359
+ );
360
+ }
353
361
}
354
362
355
363
/**
You can’t perform that action at this time.
0 commit comments