Skip to content

Commit dec04ce

Browse files
authored
Merge pull request #1093 from atrauzzi/patch-1
Allow false-y values for unsupported options
2 parents 507ab8b + b6514d0 commit dec04ce

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

pkg/stomp/StompProducer.php

+14-6
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class StompProducer implements Producer
2020
*/
2121
private $stomp;
2222

23-
/**
24-
* @param Client $stomp
25-
*/
2623
public function __construct(Client $stomp)
2724
{
2825
$this->stomp = $stomp;
@@ -45,9 +42,12 @@ public function send(Destination $destination, Message $message): void
4542
$this->stomp->send($destination->getQueueName(), $stompMessage);
4643
}
4744

45+
/**
46+
* @return $this|Producer
47+
*/
4848
public function setDeliveryDelay(int $deliveryDelay = null): Producer
4949
{
50-
if (null === $deliveryDelay) {
50+
if (empty($deliveryDelay)) {
5151
return $this;
5252
}
5353

@@ -59,9 +59,14 @@ public function getDeliveryDelay(): ?int
5959
return null;
6060
}
6161

62+
/**
63+
* @throws PriorityNotSupportedException
64+
*
65+
* @return $this|Producer
66+
*/
6267
public function setPriority(int $priority = null): Producer
6368
{
64-
if (null === $priority) {
69+
if (empty($priority)) {
6570
return $this;
6671
}
6772

@@ -73,9 +78,12 @@ public function getPriority(): ?int
7378
return null;
7479
}
7580

81+
/**
82+
* @return $this|Producer
83+
*/
7684
public function setTimeToLive(int $timeToLive = null): Producer
7785
{
78-
if (null === $timeToLive) {
86+
if (empty($timeToLive)) {
7987
return $this;
8088
}
8189

0 commit comments

Comments
 (0)