Skip to content

Commit 2b3f908

Browse files
committed
Running php-cs-fixer
Running php-cs-fixer to fix CS drift
1 parent 4904558 commit 2b3f908

File tree

431 files changed

+642
-1828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

431 files changed

+642
-1828
lines changed

pkg/amqp-bunny/AmqpConnectionFactory.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AmqpConnectionFactory implements InteropAmqpConnectionFactory, DelayStrate
2626
private $client;
2727

2828
/**
29-
* @see \Enqueue\AmqpTools\ConnectionConfig for possible config formats and values
29+
* @see ConnectionConfig for possible config formats and values
3030
*
3131
* @param array|string|null $config
3232
*/
@@ -89,10 +89,10 @@ private function establishConnection(): BunnyClient
8989
$bunnyConfig['timeout'] = $this->config->getConnectionTimeout();
9090

9191
// @see https://github.com/php-enqueue/enqueue-dev/issues/229
92-
// $bunnyConfig['persistent'] = $this->config->isPersisted();
93-
// if ($this->config->isPersisted()) {
94-
// $bunnyConfig['path'] = 'enqueue';//$this->config->getOption('path', $this->config->getOption('vhost'));
95-
// }
92+
// $bunnyConfig['persistent'] = $this->config->isPersisted();
93+
// if ($this->config->isPersisted()) {
94+
// $bunnyConfig['path'] = 'enqueue';//$this->config->getOption('path', $this->config->getOption('vhost'));
95+
// }
9696

9797
if ($this->config->getHeartbeat()) {
9898
$bunnyConfig['heartbeat'] = $this->config->getHeartbeat();

pkg/amqp-bunny/AmqpConsumer.php

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

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

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

104104
return null;

pkg/amqp-bunny/AmqpContext.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class AmqpContext implements InteropAmqpContext, DelayStrategyAware
5151
* Callable must return instance of \Bunny\Channel once called.
5252
*
5353
* @param Channel|callable $bunnyChannel
54-
* @param array $config
5554
*/
5655
public function __construct($bunnyChannel, array $config)
5756
{
@@ -294,10 +293,7 @@ public function getBunnyChannel(): Channel
294293
if (false == $this->bunnyChannel) {
295294
$bunnyChannel = call_user_func($this->bunnyChannelFactory);
296295
if (false == $bunnyChannel instanceof Channel) {
297-
throw new \LogicException(sprintf(
298-
'The factory must return instance of \Bunny\Channel. It returned %s',
299-
is_object($bunnyChannel) ? get_class($bunnyChannel) : gettype($bunnyChannel)
300-
));
296+
throw new \LogicException(sprintf('The factory must return instance of \Bunny\Channel. It returned %s', is_object($bunnyChannel) ? $bunnyChannel::class : gettype($bunnyChannel)));
301297
}
302298

303299
$this->bunnyChannel = $bunnyChannel;

pkg/amqp-bunny/AmqpProducer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function send(Destination $destination, Message $message): void
7979
/**
8080
* @return self
8181
*/
82-
public function setDeliveryDelay(int $deliveryDelay = null): Producer
82+
public function setDeliveryDelay(?int $deliveryDelay = null): Producer
8383
{
8484
if (null === $this->delayStrategy) {
8585
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
@@ -98,7 +98,7 @@ public function getDeliveryDelay(): ?int
9898
/**
9999
* @return self
100100
*/
101-
public function setPriority(int $priority = null): Producer
101+
public function setPriority(?int $priority = null): Producer
102102
{
103103
$this->priority = $priority;
104104

@@ -113,7 +113,7 @@ public function getPriority(): ?int
113113
/**
114114
* @return self
115115
*/
116-
public function setTimeToLive(int $timeToLive = null): Producer
116+
public function setTimeToLive(?int $timeToLive = null): Producer
117117
{
118118
$this->timeToLive = $timeToLive;
119119

pkg/amqp-bunny/AmqpSubscriptionConsumer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function consume(int $timeout = 0): void
4747
try {
4848
$this->context->getBunnyChannel()->getClient()->run(0 !== $timeout ? $timeout / 1000 : null);
4949
} catch (ClientException $e) {
50-
if (0 === strpos($e->getMessage(), 'stream_select() failed') && $signalHandler->wasThereSignal()) {
50+
if (str_starts_with($e->getMessage(), 'stream_select() failed') && $signalHandler->wasThereSignal()) {
5151
return;
5252
}
5353

@@ -63,7 +63,7 @@ public function consume(int $timeout = 0): void
6363
public function subscribe(Consumer $consumer, callable $callback): void
6464
{
6565
if (false == $consumer instanceof AmqpConsumer) {
66-
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, get_class($consumer)));
66+
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, $consumer::class));
6767
}
6868

6969
if ($consumer->getConsumerTag() && array_key_exists($consumer->getConsumerTag(), $this->subscribers)) {
@@ -110,7 +110,7 @@ public function subscribe(Consumer $consumer, callable $callback): void
110110
public function unsubscribe(Consumer $consumer): void
111111
{
112112
if (false == $consumer instanceof AmqpConsumer) {
113-
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, get_class($consumer)));
113+
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, $consumer::class));
114114
}
115115

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

pkg/amqp-bunny/Tests/Spec/AmqpSendAndReceiveDelayedMessageWithDelayPluginStrategyTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ public function test()
1818
$this->markTestIncomplete();
1919
}
2020

21-
/**
22-
* {@inheritdoc}
23-
*/
2421
protected function createContext()
2522
{
2623
$factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
@@ -31,8 +28,6 @@ protected function createContext()
3128

3229
/**
3330
* @param AmqpContext $context
34-
*
35-
* {@inheritdoc}
3631
*/
3732
protected function createQueue(Context $context, $queueName)
3833
{

pkg/amqp-bunny/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
{

pkg/amqp-bunny/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)

pkg/amqp-bunny/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)

pkg/amqp-bunny/Tests/Spec/AmqpSendAndReceiveTimestampAsIntegerTest.php

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

pkg/amqp-bunny/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)

pkg/amqp-bunny/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)

pkg/amqp-bunny/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)

pkg/amqp-bunny/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)

pkg/amqp-bunny/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)

pkg/amqp-bunny/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)

pkg/amqp-bunny/Tests/Spec/AmqpSslSendToAndReceiveFromQueueTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ public function test()
1919
parent::test();
2020
}
2121

22-
/**
23-
* {@inheritdoc}
24-
*/
2522
protected function createContext()
2623
{
2724
$baseDir = realpath(__DIR__.'/../../../../');
@@ -44,8 +41,6 @@ protected function createContext()
4441
}
4542

4643
/**
47-
* {@inheritdoc}
48-
*
4944
* @param AmqpContext $context
5045
*/
5146
protected function createQueue(Context $context, $queueName)

pkg/amqp-bunny/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
{

pkg/amqp-bunny/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
{

0 commit comments

Comments
 (0)