Skip to content

Commit 3403f7e

Browse files
authored
Merge pull request #154 from php-enqueue/do-not-throw-on-setting-null
[producer] do not throw exception if feature not implemented and null…
2 parents c65f1c8 + f8623ff commit 3403f7e

File tree

11 files changed

+100
-0
lines changed

11 files changed

+100
-0
lines changed

Diff for: pkg/amqp-bunny/AmqpProducer.php

+4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
9292
*/
9393
public function setDeliveryDelay($deliveryDelay)
9494
{
95+
if (null === $deliveryDelay) {
96+
return;
97+
}
98+
9599
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
96100
}
97101

Diff for: pkg/amqp-ext/AmqpProducer.php

+4
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
9999
*/
100100
public function setDeliveryDelay($deliveryDelay)
101101
{
102+
if (null === $deliveryDelay) {
103+
return;
104+
}
105+
102106
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
103107
}
104108

Diff for: pkg/amqp-lib/AmqpProducer.php

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
9494
*/
9595
public function setDeliveryDelay($deliveryDelay)
9696
{
97+
if (null === $deliveryDelay) {
98+
return;
99+
}
100+
97101
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
98102
}
99103

Diff for: pkg/dbal/DbalProducer.php

+12
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
9191
*/
9292
public function setDeliveryDelay($deliveryDelay)
9393
{
94+
if (null === $deliveryDelay) {
95+
return;
96+
}
97+
9498
throw new \LogicException('Not implemented');
9599
}
96100

@@ -107,6 +111,10 @@ public function getDeliveryDelay()
107111
*/
108112
public function setPriority($priority)
109113
{
114+
if (null === $priority) {
115+
return;
116+
}
117+
110118
throw new \LogicException('Not implemented');
111119
}
112120

@@ -123,6 +131,10 @@ public function getPriority()
123131
*/
124132
public function setTimeToLive($timeToLive)
125133
{
134+
if (null === $timeToLive) {
135+
return;
136+
}
137+
126138
throw new \LogicException('Not implemented');
127139
}
128140

Diff for: pkg/fs/FsProducer.php

+8
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
7373
*/
7474
public function setDeliveryDelay($deliveryDelay)
7575
{
76+
if (null === $deliveryDelay) {
77+
return;
78+
}
79+
7680
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
7781
}
7882

@@ -89,6 +93,10 @@ public function getDeliveryDelay()
8993
*/
9094
public function setPriority($priority)
9195
{
96+
if (null === $priority) {
97+
return;
98+
}
99+
92100
throw PriorityNotSupportedException::providerDoestNotSupportIt();
93101
}
94102

Diff for: pkg/gearman/GearmanProducer.php

+12
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
4747
*/
4848
public function setDeliveryDelay($deliveryDelay)
4949
{
50+
if (null === $deliveryDelay) {
51+
return;
52+
}
53+
5054
throw new \LogicException('Not implemented');
5155
}
5256

@@ -63,6 +67,10 @@ public function getDeliveryDelay()
6367
*/
6468
public function setPriority($priority)
6569
{
70+
if (null === $priority) {
71+
return;
72+
}
73+
6674
throw new \LogicException('Not implemented');
6775
}
6876

@@ -79,6 +87,10 @@ public function getPriority()
7987
*/
8088
public function setTimeToLive($timeToLive)
8189
{
90+
if (null === $timeToLive) {
91+
return;
92+
}
93+
8294
throw new \LogicException('Not implemented');
8395
}
8496

Diff for: pkg/pheanstalk/PheanstalkProducer.php

+12
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
5757
*/
5858
public function setDeliveryDelay($deliveryDelay)
5959
{
60+
if (null === $deliveryDelay) {
61+
return;
62+
}
63+
6064
throw new \LogicException('Not implemented');
6165
}
6266

@@ -73,6 +77,10 @@ public function getDeliveryDelay()
7377
*/
7478
public function setPriority($priority)
7579
{
80+
if (null === $priority) {
81+
return;
82+
}
83+
7684
throw new \LogicException('Not implemented');
7785
}
7886

@@ -89,6 +97,10 @@ public function getPriority()
8997
*/
9098
public function setTimeToLive($timeToLive)
9199
{
100+
if (null === $timeToLive) {
101+
return;
102+
}
103+
92104
throw new \LogicException('Not implemented');
93105
}
94106

Diff for: pkg/rdkafka/RdKafkaProducer.php

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
4848
*/
4949
public function setDeliveryDelay($deliveryDelay)
5050
{
51+
if (null === $deliveryDelay) {
52+
return;
53+
}
54+
5155
throw new \LogicException('Not implemented');
5256
}
5357

@@ -64,6 +68,10 @@ public function getDeliveryDelay()
6468
*/
6569
public function setPriority($priority)
6670
{
71+
if (null === $priority) {
72+
return;
73+
}
74+
6775
throw new \LogicException('Not implemented');
6876
}
6977

@@ -80,6 +88,10 @@ public function getPriority()
8088
*/
8189
public function setTimeToLive($timeToLive)
8290
{
91+
if (null === $timeToLive) {
92+
return;
93+
}
94+
8395
throw new \LogicException('Not implemented');
8496
}
8597

Diff for: pkg/redis/RedisProducer.php

+12
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
4242
*/
4343
public function setDeliveryDelay($deliveryDelay)
4444
{
45+
if (null === $deliveryDelay) {
46+
return;
47+
}
48+
4549
throw new \LogicException('Not implemented');
4650
}
4751

@@ -58,6 +62,10 @@ public function getDeliveryDelay()
5862
*/
5963
public function setPriority($priority)
6064
{
65+
if (null === $priority) {
66+
return;
67+
}
68+
6169
throw new \LogicException('Not implemented');
6270
}
6371

@@ -74,6 +82,10 @@ public function getPriority()
7482
*/
7583
public function setTimeToLive($timeToLive)
7684
{
85+
if (null === $timeToLive) {
86+
return;
87+
}
88+
7789
throw new \LogicException('Not implemented');
7890
}
7991

Diff for: pkg/sqs/SqsProducer.php

+8
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ public function getDeliveryDelay()
108108
*/
109109
public function setPriority($priority)
110110
{
111+
if (null === $priority) {
112+
return;
113+
}
114+
111115
throw PriorityNotSupportedException::providerDoestNotSupportIt();
112116
}
113117

@@ -124,6 +128,10 @@ public function getPriority()
124128
*/
125129
public function setTimeToLive($timeToLive)
126130
{
131+
if (null === $timeToLive) {
132+
return;
133+
}
134+
127135
throw TimeToLiveNotSupportedException::providerDoestNotSupportIt();
128136
}
129137

Diff for: pkg/stomp/StompProducer.php

+12
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public function send(PsrDestination $destination, PsrMessage $message)
5050
*/
5151
public function setDeliveryDelay($deliveryDelay)
5252
{
53+
if (null === $deliveryDelay) {
54+
return;
55+
}
56+
5357
throw new \LogicException('Not implemented');
5458
}
5559

@@ -66,6 +70,10 @@ public function getDeliveryDelay()
6670
*/
6771
public function setPriority($priority)
6872
{
73+
if (null === $priority) {
74+
return;
75+
}
76+
6977
throw new \LogicException('Not implemented');
7078
}
7179

@@ -82,6 +90,10 @@ public function getPriority()
8290
*/
8391
public function setTimeToLive($timeToLive)
8492
{
93+
if (null === $timeToLive) {
94+
return;
95+
}
96+
8597
throw new \LogicException('Not implemented');
8698
}
8799

0 commit comments

Comments
 (0)