Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 44437dd

Browse files
committed
More CS Fixes
1 parent 8e72d15 commit 44437dd

File tree

9 files changed

+38
-38
lines changed

9 files changed

+38
-38
lines changed

‎pkg/amqp-ext/AmqpConsumer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function reject(Message $message, bool $requeue = false): void
130130

131131
$this->getExtQueue()->reject(
132132
$message->getDeliveryTag(),
133-
$requeue ? AMQP_REQUEUE : AMQP_NOPARAM
133+
$requeue ? \AMQP_REQUEUE : \AMQP_NOPARAM
134134
);
135135
}
136136

‎pkg/amqp-ext/AmqpContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function unbind(InteropAmqpBind $bind): void
177177
public function createTemporaryQueue(): Queue
178178
{
179179
$extQueue = new \AMQPQueue($this->getExtChannel());
180-
$extQueue->setFlags(AMQP_EXCLUSIVE);
180+
$extQueue->setFlags(\AMQP_EXCLUSIVE);
181181

182182
$extQueue->declareQueue();
183183

‎pkg/amqp-ext/AmqpProducer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function doSend(AmqpDestination $destination, AmqpMessage $message): voi
146146
} else {
147147
/** @var AmqpQueue $destination */
148148
$amqpExchange = new \AMQPExchange($this->amqpChannel);
149-
$amqpExchange->setType(AMQP_EX_TYPE_DIRECT);
149+
$amqpExchange->setType(\AMQP_EX_TYPE_DIRECT);
150150
$amqpExchange->setName('');
151151

152152
$amqpExchange->publish(

‎pkg/amqp-ext/Flags.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,86 +12,86 @@ class Flags
1212
{
1313
public static function convertMessageFlags(int $interop): int
1414
{
15-
$flags = AMQP_NOPARAM;
15+
$flags = \AMQP_NOPARAM;
1616

1717
if ($interop & InteropAmqpMessage::FLAG_MANDATORY) {
18-
$flags |= AMQP_MANDATORY;
18+
$flags |= \AMQP_MANDATORY;
1919
}
2020

2121
if ($interop & InteropAmqpMessage::FLAG_IMMEDIATE) {
22-
$flags |= AMQP_IMMEDIATE;
22+
$flags |= \AMQP_IMMEDIATE;
2323
}
2424

2525
return $flags;
2626
}
2727

2828
public static function convertTopicFlags(int $interop): int
2929
{
30-
$flags = AMQP_NOPARAM;
30+
$flags = \AMQP_NOPARAM;
3131

3232
$flags |= static::convertDestinationFlags($interop);
3333

3434
if ($interop & InteropAmqpTopic::FLAG_INTERNAL) {
35-
$flags |= AMQP_INTERNAL;
35+
$flags |= \AMQP_INTERNAL;
3636
}
3737

3838
return $flags;
3939
}
4040

4141
public static function convertQueueFlags(int $interop): int
4242
{
43-
$flags = AMQP_NOPARAM;
43+
$flags = \AMQP_NOPARAM;
4444

4545
$flags |= static::convertDestinationFlags($interop);
4646

4747
if ($interop & InteropAmqpQueue::FLAG_EXCLUSIVE) {
48-
$flags |= AMQP_EXCLUSIVE;
48+
$flags |= \AMQP_EXCLUSIVE;
4949
}
5050

5151
return $flags;
5252
}
5353

5454
public static function convertDestinationFlags(int $interop): int
5555
{
56-
$flags = AMQP_NOPARAM;
56+
$flags = \AMQP_NOPARAM;
5757

5858
if ($interop & InteropAmqpDestination::FLAG_PASSIVE) {
59-
$flags |= AMQP_PASSIVE;
59+
$flags |= \AMQP_PASSIVE;
6060
}
6161

6262
if ($interop & InteropAmqpDestination::FLAG_DURABLE) {
63-
$flags |= AMQP_DURABLE;
63+
$flags |= \AMQP_DURABLE;
6464
}
6565

6666
if ($interop & InteropAmqpDestination::FLAG_AUTODELETE) {
67-
$flags |= AMQP_AUTODELETE;
67+
$flags |= \AMQP_AUTODELETE;
6868
}
6969

7070
if ($interop & InteropAmqpDestination::FLAG_NOWAIT) {
71-
$flags |= AMQP_NOWAIT;
71+
$flags |= \AMQP_NOWAIT;
7272
}
7373

7474
return $flags;
7575
}
7676

7777
public static function convertConsumerFlags(int $interop): int
7878
{
79-
$flags = AMQP_NOPARAM;
79+
$flags = \AMQP_NOPARAM;
8080

8181
if ($interop & InteropAmqpConsumer::FLAG_NOLOCAL) {
82-
$flags |= AMQP_NOLOCAL;
82+
$flags |= \AMQP_NOLOCAL;
8383
}
8484

8585
if ($interop & InteropAmqpConsumer::FLAG_NOACK) {
86-
$flags |= AMQP_AUTOACK;
86+
$flags |= \AMQP_AUTOACK;
8787
}
8888

8989
if ($interop & InteropAmqpConsumer::FLAG_EXCLUSIVE) {
90-
$flags |= AMQP_EXCLUSIVE;
90+
$flags |= \AMQP_EXCLUSIVE;
9191
}
9292

9393
if ($interop & InteropAmqpConsumer::FLAG_NOWAIT) {
94-
$flags |= AMQP_NOWAIT;
94+
$flags |= \AMQP_NOWAIT;
9595
}
9696

9797
return $flags;

‎pkg/rdkafka/RdKafkaConsumer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ private function doReceive(int $timeout): ?RdKafkaMessage
167167
}
168168

169169
switch ($kafkaMessage->err) {
170-
case RD_KAFKA_RESP_ERR__PARTITION_EOF:
171-
case RD_KAFKA_RESP_ERR__TIMED_OUT:
172-
case RD_KAFKA_RESP_ERR__TRANSPORT:
170+
case \RD_KAFKA_RESP_ERR__PARTITION_EOF:
171+
case \RD_KAFKA_RESP_ERR__TIMED_OUT:
172+
case \RD_KAFKA_RESP_ERR__TRANSPORT:
173173
return null;
174-
case RD_KAFKA_RESP_ERR_NO_ERROR:
174+
case \RD_KAFKA_RESP_ERR_NO_ERROR:
175175
$message = $this->serializer->toMessage($kafkaMessage->payload);
176176
$message->setKey($kafkaMessage->key);
177177
$message->setPartition($kafkaMessage->partition);

‎pkg/rdkafka/RdKafkaContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ public static function getLibrdKafkaVersion(): string
173173
if (!defined('RD_KAFKA_VERSION')) {
174174
throw new \RuntimeException('RD_KAFKA_VERSION constant is not defined. Phprdkafka is probably not installed');
175175
}
176-
$major = (RD_KAFKA_VERSION & 0xFF000000) >> 24;
177-
$minor = (RD_KAFKA_VERSION & 0x00FF0000) >> 16;
178-
$patch = (RD_KAFKA_VERSION & 0x0000FF00) >> 8;
176+
$major = (\RD_KAFKA_VERSION & 0xFF000000) >> 24;
177+
$minor = (\RD_KAFKA_VERSION & 0x00FF0000) >> 16;
178+
$patch = (\RD_KAFKA_VERSION & 0x0000FF00) >> 8;
179179

180180
return "$major.$minor.$patch";
181181
}

‎pkg/rdkafka/RdKafkaProducer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function send(Destination $destination, Message $message): void
3737
InvalidDestinationException::assertDestinationInstanceOf($destination, RdKafkaTopic::class);
3838
InvalidMessageException::assertMessageInstanceOf($message, RdKafkaMessage::class);
3939

40-
$partition = $message->getPartition() ?? $destination->getPartition() ?? RD_KAFKA_PARTITION_UA;
40+
$partition = $message->getPartition() ?? $destination->getPartition() ?? \RD_KAFKA_PARTITION_UA;
4141
$payload = $this->serializer->toString($message);
4242
$key = $message->getKey() ?? $destination->getKey() ?? null;
4343

‎pkg/rdkafka/Tests/RdKafkaConsumerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testShouldReceiveFromQueueAndReturnNullIfNoMessageInQueue()
3232
$destination = new RdKafkaTopic('dest');
3333

3434
$kafkaMessage = new Message();
35-
$kafkaMessage->err = RD_KAFKA_RESP_ERR__TIMED_OUT;
35+
$kafkaMessage->err = \RD_KAFKA_RESP_ERR__TIMED_OUT;
3636

3737
$kafkaConsumer = $this->createKafkaConsumerMock();
3838
$kafkaConsumer
@@ -61,7 +61,7 @@ public function testShouldPassProperlyConfiguredTopicPartitionOnAssign()
6161
$destination = new RdKafkaTopic('dest');
6262

6363
$kafkaMessage = new Message();
64-
$kafkaMessage->err = RD_KAFKA_RESP_ERR__TIMED_OUT;
64+
$kafkaMessage->err = \RD_KAFKA_RESP_ERR__TIMED_OUT;
6565

6666
$kafkaConsumer = $this->createKafkaConsumerMock();
6767
$kafkaConsumer
@@ -91,7 +91,7 @@ public function testShouldSubscribeOnFirstReceiveOnly()
9191
$destination = new RdKafkaTopic('dest');
9292

9393
$kafkaMessage = new Message();
94-
$kafkaMessage->err = RD_KAFKA_RESP_ERR__TIMED_OUT;
94+
$kafkaMessage->err = \RD_KAFKA_RESP_ERR__TIMED_OUT;
9595

9696
$kafkaConsumer = $this->createKafkaConsumerMock();
9797
$kafkaConsumer
@@ -122,7 +122,7 @@ public function testShouldAssignWhenOffsetIsSet()
122122
$destination->setPartition(1);
123123

124124
$kafkaMessage = new Message();
125-
$kafkaMessage->err = RD_KAFKA_RESP_ERR__TIMED_OUT;
125+
$kafkaMessage->err = \RD_KAFKA_RESP_ERR__TIMED_OUT;
126126

127127
$kafkaConsumer = $this->createKafkaConsumerMock();
128128
$kafkaConsumer
@@ -154,7 +154,7 @@ public function testThrowOnOffsetChangeAfterSubscribing()
154154
$destination = new RdKafkaTopic('dest');
155155

156156
$kafkaMessage = new Message();
157-
$kafkaMessage->err = RD_KAFKA_RESP_ERR__TIMED_OUT;
157+
$kafkaMessage->err = \RD_KAFKA_RESP_ERR__TIMED_OUT;
158158

159159
$kafkaConsumer = $this->createKafkaConsumerMock();
160160
$kafkaConsumer
@@ -188,7 +188,7 @@ public function testShouldReceiveFromQueueAndReturnMessageIfMessageInQueue()
188188
$expectedMessage = new RdKafkaMessage('theBody', ['foo' => 'fooVal'], ['bar' => 'barVal']);
189189

190190
$kafkaMessage = new Message();
191-
$kafkaMessage->err = RD_KAFKA_RESP_ERR_NO_ERROR;
191+
$kafkaMessage->err = \RD_KAFKA_RESP_ERR_NO_ERROR;
192192
$kafkaMessage->payload = 'theSerializedMessage';
193193

194194
$kafkaConsumer = $this->createKafkaConsumerMock();

‎pkg/rdkafka/Tests/RdKafkaProducerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testShouldUseSerializerToEncodeMessageAndPutToExpectedTube()
4646
->expects($this->once())
4747
->method('producev')
4848
->with(
49-
RD_KAFKA_PARTITION_UA,
49+
\RD_KAFKA_PARTITION_UA,
5050
0,
5151
'theSerializedMessage',
5252
'key',
@@ -183,7 +183,7 @@ public function testShouldAllowSerializersToSerializeKeys()
183183
->expects($this->once())
184184
->method('producev')
185185
->with(
186-
RD_KAFKA_PARTITION_UA,
186+
\RD_KAFKA_PARTITION_UA,
187187
0,
188188
'theSerializedMessage',
189189
'theSerializedKey'
@@ -324,7 +324,7 @@ public function testShouldAllowFalsyKeyFromMessage(): void
324324
->expects($this->once())
325325
->method('producev')
326326
->with(
327-
RD_KAFKA_PARTITION_UA,
327+
\RD_KAFKA_PARTITION_UA,
328328
0,
329329
'',
330330
$key
@@ -354,7 +354,7 @@ public function testShouldAllowFalsyKeyFromDestination(): void
354354
->expects($this->once())
355355
->method('producev')
356356
->with(
357-
RD_KAFKA_PARTITION_UA,
357+
\RD_KAFKA_PARTITION_UA,
358358
0,
359359
'',
360360
$key

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /