Skip to content

Commit 4021069

Browse files
authored
Merge pull request #513 from ArnaudTarroux/0.8
Remove bool typehint for php < 7 supports
2 parents 56e459c + 89d2330 commit 4021069

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: pkg/enqueue/Consumption/QueueConsumer.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,18 @@ public function consume(ExtensionInterface $runtimeExtension = null)
346346

347347
/**
348348
* @param bool $enableSubscriptionConsumer
349+
* @throws \Enqueue\Consumption\Exception\InvalidArgumentException
349350
*/
350-
public function enableSubscriptionConsumer(bool $enableSubscriptionConsumer)
351+
public function enableSubscriptionConsumer($enableSubscriptionConsumer)
351352
{
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+
}
353361
}
354362

355363
/**

0 commit comments

Comments
 (0)