Skip to content

Commit 1660cc1

Browse files
committed
Running php-cs-fixer
Running php-cs-fixer to fix CS drift
1 parent af39d30 commit 1660cc1

24 files changed

+17
-95
lines changed

AmqpConnectionFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AmqpConnectionFactory implements InteropAmqpConnectionFactory, DelayStrate
3232
private $connection;
3333

3434
/**
35-
* @see \Enqueue\AmqpTools\ConnectionConfig for possible config formats and values.
35+
* @see ConnectionConfig for possible config formats and values.
3636
*
3737
* @param array|string|null $config
3838
*/

AmqpConsumer.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(AmqpContext $context, InteropAmqpQueue $queue)
4747
$this->flags = self::FLAG_NOPARAM;
4848
}
4949

50-
public function setConsumerTag(string $consumerTag = null): void
50+
public function setConsumerTag(?string $consumerTag = null): void
5151
{
5252
$this->consumerTag = $consumerTag;
5353
}
@@ -97,7 +97,7 @@ public function receive(int $timeout = 0): ?Message
9797
return $message;
9898
}
9999

100-
usleep(100000); //100ms
100+
usleep(100000); // 100ms
101101
}
102102

103103
return null;
@@ -127,7 +127,6 @@ public function acknowledge(Message $message): void
127127

128128
/**
129129
* @param InteropAmqpMessage $message
130-
* @param bool $requeue
131130
*/
132131
public function reject(Message $message, bool $requeue = false): void
133132
{

AmqpProducer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function send(Destination $destination, Message $message): void
8181
/**
8282
* @return self
8383
*/
84-
public function setDeliveryDelay(int $deliveryDelay = null): Producer
84+
public function setDeliveryDelay(?int $deliveryDelay = null): Producer
8585
{
8686
if (null === $this->delayStrategy) {
8787
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
@@ -100,7 +100,7 @@ public function getDeliveryDelay(): ?int
100100
/**
101101
* @return self
102102
*/
103-
public function setPriority(int $priority = null): Producer
103+
public function setPriority(?int $priority = null): Producer
104104
{
105105
$this->priority = $priority;
106106

@@ -115,7 +115,7 @@ public function getPriority(): ?int
115115
/**
116116
* @return self
117117
*/
118-
public function setTimeToLive(int $timeToLive = null): Producer
118+
public function setTimeToLive(?int $timeToLive = null): Producer
119119
{
120120
$this->timeToLive = $timeToLive;
121121

AmqpSubscriptionConsumer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function consume(int $timeout = 0): void
9393
public function subscribe(Consumer $consumer, callable $callback): void
9494
{
9595
if (false == $consumer instanceof AmqpConsumer) {
96-
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, get_class($consumer)));
96+
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, $consumer::class));
9797
}
9898

9999
if ($consumer->getConsumerTag() && array_key_exists($consumer->getConsumerTag(), $this->subscribers)) {
@@ -140,7 +140,7 @@ public function subscribe(Consumer $consumer, callable $callback): void
140140
public function unsubscribe(Consumer $consumer): void
141141
{
142142
if (false == $consumer instanceof AmqpConsumer) {
143-
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, get_class($consumer)));
143+
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, $consumer::class));
144144
}
145145

146146
if (false == $consumer->getConsumerTag()) {

Tests/Spec/AmqpProducerTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
*/
1111
class AmqpProducerTest extends ProducerSpec
1212
{
13-
/**
14-
* {@inheritdoc}
15-
*/
1613
protected function createProducer()
1714
{
1815
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));

Tests/Spec/AmqpSendAndReceiveDelayedMessageWithDelayPluginStrategyTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
*/
1414
class AmqpSendAndReceiveDelayedMessageWithDelayPluginStrategyTest extends SendAndReceiveDelayedMessageFromQueueSpec
1515
{
16-
/**
17-
* {@inheritdoc}
18-
*/
1916
protected function createContext()
2017
{
2118
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -26,8 +23,6 @@ protected function createContext()
2623

2724
/**
2825
* @param AmqpContext $context
29-
*
30-
* {@inheritdoc}
3126
*/
3227
protected function createQueue(Context $context, $queueName)
3328
{

Tests/Spec/AmqpSendAndReceiveDelayedMessageWithDlxStrategyTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
*/
1414
class AmqpSendAndReceiveDelayedMessageWithDlxStrategyTest extends SendAndReceiveDelayedMessageFromQueueSpec
1515
{
16-
/**
17-
* {@inheritdoc}
18-
*/
1916
protected function createContext()
2017
{
2118
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -26,8 +23,6 @@ protected function createContext()
2623

2724
/**
2825
* @param AmqpContext $context
29-
*
30-
* {@inheritdoc}
3126
*/
3227
protected function createQueue(Context $context, $queueName)
3328
{

Tests/Spec/AmqpSendAndReceivePriorityMessagesFromQueueTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
class AmqpSendAndReceivePriorityMessagesFromQueueTest extends SendAndReceivePriorityMessagesFromQueueSpec
1414
{
15-
/**
16-
* {@inheritdoc}
17-
*/
1815
protected function createContext()
1916
{
2017
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -23,8 +20,6 @@ protected function createContext()
2320
}
2421

2522
/**
26-
* {@inheritdoc}
27-
*
2823
* @param AmqpContext $context
2924
*/
3025
protected function createQueue(Context $context, $queueName)

Tests/Spec/AmqpSendAndReceiveTimeToLiveMessagesFromQueueTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
class AmqpSendAndReceiveTimeToLiveMessagesFromQueueTest extends SendAndReceiveTimeToLiveMessagesFromQueueSpec
1414
{
15-
/**
16-
* {@inheritdoc}
17-
*/
1815
protected function createContext()
1916
{
2017
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -23,8 +20,6 @@ protected function createContext()
2320
}
2421

2522
/**
26-
* {@inheritdoc}
27-
*
2823
* @param AmqpContext $context
2924
*/
3025
protected function createQueue(Context $context, $queueName)

Tests/Spec/AmqpSendAndReceiveTimestampAsIntengerTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
*/
1111
class AmqpSendAndReceiveTimestampAsIntengerTest extends SendAndReceiveTimestampAsIntegerSpec
1212
{
13-
/**
14-
* {@inheritdoc}
15-
*/
1613
protected function createContext()
1714
{
1815
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));

Tests/Spec/AmqpSendToAndReceiveFromQueueTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
class AmqpSendToAndReceiveFromQueueTest extends SendToAndReceiveFromQueueSpec
1414
{
15-
/**
16-
* {@inheritdoc}
17-
*/
1815
protected function createContext()
1916
{
2017
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -23,8 +20,6 @@ protected function createContext()
2320
}
2421

2522
/**
26-
* {@inheritdoc}
27-
*
2823
* @param AmqpContext $context
2924
*/
3025
protected function createQueue(Context $context, $queueName)

Tests/Spec/AmqpSendToAndReceiveFromTopicTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
*/
1414
class AmqpSendToAndReceiveFromTopicTest extends SendToAndReceiveFromTopicSpec
1515
{
16-
/**
17-
* {@inheritdoc}
18-
*/
1916
protected function createContext()
2017
{
2118
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -24,8 +21,6 @@ protected function createContext()
2421
}
2522

2623
/**
27-
* {@inheritdoc}
28-
*
2924
* @param AmqpContext $context
3025
*/
3126
protected function createTopic(Context $context, $topicName)

Tests/Spec/AmqpSendToAndReceiveNoWaitFromQueueTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
class AmqpSendToAndReceiveNoWaitFromQueueTest extends SendToAndReceiveNoWaitFromQueueSpec
1414
{
15-
/**
16-
* {@inheritdoc}
17-
*/
1815
protected function createContext()
1916
{
2017
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -23,8 +20,6 @@ protected function createContext()
2320
}
2421

2522
/**
26-
* {@inheritdoc}
27-
*
2823
* @param AmqpContext $context
2924
*/
3025
protected function createQueue(Context $context, $queueName)

Tests/Spec/AmqpSendToAndReceiveNoWaitFromTopicTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
*/
1414
class AmqpSendToAndReceiveNoWaitFromTopicTest extends SendToAndReceiveNoWaitFromTopicSpec
1515
{
16-
/**
17-
* {@inheritdoc}
18-
*/
1916
protected function createContext()
2017
{
2118
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -24,8 +21,6 @@ protected function createContext()
2421
}
2522

2623
/**
27-
* {@inheritdoc}
28-
*
2924
* @param AmqpContext $context
3025
*/
3126
protected function createTopic(Context $context, $topicName)

Tests/Spec/AmqpSendToTopicAndReceiveFromQueueTest.php

-7
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
*/
1515
class AmqpSendToTopicAndReceiveFromQueueTest extends SendToTopicAndReceiveFromQueueSpec
1616
{
17-
/**
18-
* {@inheritdoc}
19-
*/
2017
protected function createContext()
2118
{
2219
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -25,8 +22,6 @@ protected function createContext()
2522
}
2623

2724
/**
28-
* {@inheritdoc}
29-
*
3025
* @param AmqpContext $context
3126
*/
3227
protected function createQueue(Context $context, $queueName)
@@ -41,8 +36,6 @@ protected function createQueue(Context $context, $queueName)
4136
}
4237

4338
/**
44-
* {@inheritdoc}
45-
*
4639
* @param AmqpContext $context
4740
*/
4841
protected function createTopic(Context $context, $topicName)

Tests/Spec/AmqpSendToTopicAndReceiveNoWaitFromQueueTest.php

-7
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
*/
1515
class AmqpSendToTopicAndReceiveNoWaitFromQueueTest extends SendToTopicAndReceiveNoWaitFromQueueSpec
1616
{
17-
/**
18-
* {@inheritdoc}
19-
*/
2017
protected function createContext()
2118
{
2219
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -25,8 +22,6 @@ protected function createContext()
2522
}
2623

2724
/**
28-
* {@inheritdoc}
29-
*
3025
* @param AmqpContext $context
3126
*/
3227
protected function createQueue(Context $context, $queueName)
@@ -41,8 +36,6 @@ protected function createQueue(Context $context, $queueName)
4136
}
4237

4338
/**
44-
* {@inheritdoc}
45-
*
4639
* @param AmqpContext $context
4740
*/
4841
protected function createTopic(Context $context, $topicName)

Tests/Spec/AmqpSslSendToAndReceiveFromQueueTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
class AmqpSslSendToAndReceiveFromQueueTest extends SendToAndReceiveFromQueueSpec
1414
{
15-
/**
16-
* {@inheritdoc}
17-
*/
1815
protected function createContext()
1916
{
2017
$baseDir = realpath(__DIR__.'/../../../../');
@@ -37,8 +34,6 @@ protected function createContext()
3734
}
3835

3936
/**
40-
* {@inheritdoc}
41-
*
4237
* @param AmqpContext $context
4338
*/
4439
protected function createQueue(Context $context, $queueName)

Tests/Spec/AmqpSubscriptionConsumerConsumeFromAllSubscribedQueuesTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class AmqpSubscriptionConsumerConsumeFromAllSubscribedQueuesTest extends Subscri
1515
{
1616
/**
1717
* @return AmqpContext
18-
*
19-
* {@inheritdoc}
2018
*/
2119
protected function createContext()
2220
{
@@ -30,8 +28,6 @@ protected function createContext()
3028

3129
/**
3230
* @param AmqpContext $context
33-
*
34-
* {@inheritdoc}
3531
*/
3632
protected function createQueue(Context $context, $queueName)
3733
{

Tests/Spec/AmqpSubscriptionConsumerConsumeUntilUnsubscribedTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ protected function tearDown(): void
2424

2525
/**
2626
* @return AmqpContext
27-
*
28-
* {@inheritdoc}
2927
*/
3028
protected function createContext()
3129
{
@@ -39,8 +37,6 @@ protected function createContext()
3937

4038
/**
4139
* @param AmqpContext $context
42-
*
43-
* {@inheritdoc}
4440
*/
4541
protected function createQueue(Context $context, $queueName)
4642
{

Tests/Spec/AmqpSubscriptionConsumerStopOnFalseTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class AmqpSubscriptionConsumerStopOnFalseTest extends SubscriptionConsumerStopOn
1515
{
1616
/**
1717
* @return AmqpContext
18-
*
19-
* {@inheritdoc}
2018
*/
2119
protected function createContext()
2220
{
@@ -30,8 +28,6 @@ protected function createContext()
3028

3129
/**
3230
* @param AmqpContext $context
33-
*
34-
* {@inheritdoc}
3531
*/
3632
protected function createQueue(Context $context, $queueName)
3733
{

examples/consume.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if ($autoload) {
1313
require_once $autoload;
1414
} else {
15-
throw new \LogicException('Composer autoload was not found');
15+
throw new LogicException('Composer autoload was not found');
1616
}
1717

1818
use Enqueue\AmqpLib\AmqpConnectionFactory;
@@ -32,7 +32,7 @@
3232

3333
while (true) {
3434
if ($m = $consumer->receive(100)) {
35-
echo $m->getBody(), PHP_EOL;
35+
echo $m->getBody(), \PHP_EOL;
3636
$consumer->acknowledge($m);
3737
}
3838

0 commit comments

Comments
 (0)