Skip to content

Allow false-y values for unsupported options #1093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions pkg/stomp/StompProducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class StompProducer implements Producer
*/
private $stomp;

/**
* @param Client $stomp
*/
public function __construct(Client $stomp)
{
$this->stomp = $stomp;
Expand All @@ -45,9 +42,12 @@ public function send(Destination $destination, Message $message): void
$this->stomp->send($destination->getQueueName(), $stompMessage);
}

/**
* @return $this|Producer
*/
public function setDeliveryDelay(int $deliveryDelay = null): Producer
{
if (null === $deliveryDelay) {
if (empty($deliveryDelay)) {
return $this;
}

Expand All @@ -59,9 +59,14 @@ public function getDeliveryDelay(): ?int
return null;
}

/**
* @throws PriorityNotSupportedException
*
* @return $this|Producer
*/
public function setPriority(int $priority = null): Producer
{
if (null === $priority) {
if (empty($priority)) {
return $this;
}

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

/**
* @return $this|Producer
*/
public function setTimeToLive(int $timeToLive = null): Producer
{
if (null === $timeToLive) {
if (empty($timeToLive)) {
return $this;
}

Expand Down