8000 Explicit nullable types · queue-interop/queue-interop@36d5b17 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 36d5b17

Browse files
committed
Explicit nullable types
1 parent 117043f commit 36d5b17

10 files changed

+27
-27
lines changed

src/Exception/DeliveryDelayNotSupportedException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ class DeliveryDelayNotSupportedException extends Exception
77
{
88
/**
99
* @param int $code
10-
* @param \Throwable $previous
10+
* @param \Throwable|null $previous
1111
*
1212
* @return static
1313
*/
14-
public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self
14+
public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self
1515
{
1616
return new static('The provider does not support delivery delay feature', $code, $previous);
1717
}
18-
}
18+
}

src/Exception/PriorityNotSupportedException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class PriorityNotSupportedException extends Exception
77
{
88
/**
99
* @param int $code
10-
* @param \Throwable $previous
10+
* @param \Throwable|null $previous
1111
*
1212
* @return static
1313
*/
14-
public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self
14+
public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self
1515
{
1616
return new static('The provider does not support priority feature', $code, $previous);
1717
}

src/Exception/PurgeQueueNotSupportedException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class PurgeQueueNotSupportedException extends Exception
77
{
88
/**
99
* @param int $code
10-
* @param \Throwable $previous
10+
* @param \Throwable|null $previous
1111
*
1212
* @return static
1313
*/
14-
public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self
14+
public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self
1515
{
1616
return new static('The provider does not support purge queue.', $code, $previous);
1717
}

src/Exception/SubscriptionConsumerNotSupportedException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class SubscriptionConsumerNotSupportedException extends Exception
77
{
88
/**
99
* @param int $code
10-
* @param \Throwable $previous
10+
* @param \Throwable|null $previous
1111
*
1212
* @return static
1313
*/
14-
public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self
14+
public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self
1515
{
1616
return new static('The provider does not support subscription consumer.', $code, $previous);
1717
}

src/Exception/TemporaryQueueNotSupportedException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class TemporaryQueueNotSupportedException extends Exception
77
{
88
/**
99
* @param int $code
10-
* @param \Throwable $previous
10+
* @param \Throwable|null $previous
1111
*
1212
* @return static
1313
*/
14-
public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self
14+
public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self
1515
{
1616
return new static('The provider does not support temporary queue feature', $code, $previous);
1717
}

src/Exception/TimeToLiveNotSupportedException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class TimeToLiveNotSupportedException extends Exception
77
{
88
/**
99
* @param int $code
10-
* @param \Throwable $previous
10+
* @param \Throwable|null $previous
1111
*
1212
* @return static
1313
*/
14-
public static function providerDoestNotSupportIt(int $code = 0, \Throwable $previous = null): self
14+
public static function providerDoestNotSupportIt(int $code = 0, ?\Throwable $previous = null): self
1515
{
1616
return new static('The provider does not support time to live feature', $code, $previous);
1717
}

src/Impl/ConsumerVisibilityTimeoutTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function getVisibilityTimeout(): ?int
2323
* The duration (in seconds) that the received messages are hidden from subsequent retrieve
2424
* requests after being retrieved by a ReceiveMessage request.
2525
*/
26-
public function setVisibilityTimeout(int $visibilityTimeout = null): void
26+
public function setVisibilityTimeout(?int $visibilityTimeout = null): void
2727
{
2828
$this->visibilityTimeout = $visibilityTimeout;
2929
}

src/Impl/MessageTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function isRedelivered(): bool
9797
return $this->redelivered;
9898
}
9999

100-
public function setCorrelationId(string $correlationId = null): void
100+
public function setCorrelationId(?string $correlationId = null): void
101101
{
102102
$this->setHeader('correlation_id', $correlationId);
103103
}
@@ -107,7 +107,7 @@ public function getCorrelationId(): ?string
107107
return $this->getHeader('correlation_id');
108108
}
109109

110-
public function setMessageId(string $messageId = null): void
110+
public function setMessageId(?string $messageId = null): void
111111
{
112112
$this->setHeader('message_id', $messageId);
113113
}
@@ -124,12 +124,12 @@ public function getTimestamp(): ?int
124124
return null === $value ? null : (int) $value;
125125
}
126126

127-
public function setTimestamp(int $timestamp = null): void
127+
public function setTimestamp(?int $timestamp = null): void
128128
{
129129
$this->setHeader('timestamp', $timestamp);
130130
}
131131

132-
public function setReplyTo(string $replyTo = null): void
132+
public function setReplyTo(?string $replyTo = null): void
133133
{
134134
$this->setHeader('reply_to', $replyTo);
135135
}

src/Message.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function isRedelivered(): bool;
5757
* A client can use the correlation header field to link one message with another.
5858
* A typical use is to link a response message with its request message.
5959
*/
60-
public function setCorrelationId(string $correlationId = null): void;
60+
public function setCorrelationId(?string $correlationId = null): void;
6161

6262
/**
6363
* Gets the correlation ID for the message.
@@ -71,7 +71,7 @@ public function getCorrelationId(): ?string;
7171
* Providers set this field when a message is sent.
7272
* This method can be used to change the value for a message that has been received.
7373
*/
74-
public function setMessageId(string $messageId = null): void;
74+
public function setMessageId(?string $messageId = null): void;
7575

7676
/**
7777
* Gets the message Id.
@@ -94,7 +94,7 @@ public function getTimestamp(): ?int;
9494
* Providers set this field when a message is sent.
9595
* This method can be used to change the value for a message that has been received.
9696
*/
97-
public function setTimestamp(int $timestamp = null): void;
97+
public function setTimestamp(?int $timestamp = null): void;
9898

9999
/**
100100
* Sets the destination to which a reply to this message should be sent.
@@ -108,10 +108,10 @@ public function setTimestamp(int $timestamp = null): void;
108108
* The client can use the CorrelationID header field for this purpose.
109109
110110
*/
111-
public function setReplyTo(string $replyTo = null): void;
111+
public function setReplyTo(?string $replyTo = null): void;
112112

113113
/**
114114
* Gets the destination to which a reply to this message should be sent.
115115
*/
116116
public function getReplyTo(): ?string;
117-
}
117+
}

src/Producer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function send(Destination $destination, Message $message): void;
2626
*
2727
* @throws DeliveryDelayNotSupportedException if producer does not support delivery delay feature
2828
*/
29-
public function setDeliveryDelay(int $deliveryDelay = null): self;
29+
public function setDeliveryDelay(?int $deliveryDelay = null): self;
3030

3131
/**
3232
* Gets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer.
@@ -45,7 +45,7 @@ public function getDeliveryDelay(): ?int;
4545
*
4646
* @throws PriorityNotSupportedException if producer does not support priority feature
4747
*/
48-
public function setPriority(int $priority = null): self;
48+
public function setPriority(?int $priority = null): self;
4949

5050
/**
5151
* Return the priority of messages that are sent using this Producer
@@ -65,12 +65,12 @@ public function getPriority(): ?int;
6565
*
6666
* @throws TimeToLiveNotSupportedException if producer does not support time to live feature
6767
*/
68-
public function setTimeToLive(int $timeToLive = null): self;
68+
public function setTimeToLive(?int $timeToLive = null): self;
6969

7070
/**
7171
* Returns the time to live of messages that are sent using this JMSProducer.
7272
*
7373
* @return int|null the message time to live in milliseconds; a value of zero means that a message never expires.
7474
*/
7575
public function getTimeToLive(): ?int;
76-
}
76+
}

0 commit comments

Comments
 (0)
0