Skip to content

Commit ea9b52b

Browse files
iamfarhadgithub-actions[bot]
authored andcommitted
PHP Linting (Pint)
1 parent 5aa871f commit ea9b52b

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/RabbitQueue.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function push($job, $data = '', $queue = null): ?string
132132
$this->createPayload($job, $this->getQueue($queue), $data),
133133
$queue,
134134
null,
135-
fn($payload, $queue) => $this->pushRaw($payload, $queue)
135+
fn ($payload, $queue) => $this->pushRaw($payload, $queue)
136136
);
137137
}
138138

@@ -171,7 +171,7 @@ public function later($delay, $job, $data = '', $queue = null): ?string
171171
$this->createPayload($job, $this->getQueue($queue), $data),
172172
$queue,
173173
$delay,
174-
fn($payload, $queue, $delay) => $this->laterRaw($delay, $payload, $queue)
174+
fn ($payload, $queue, $delay) => $this->laterRaw($delay, $payload, $queue)
175175
);
176176
}
177177

@@ -195,7 +195,7 @@ public function laterRaw($delay, $payload, $queue = null, $attempts = 2): ?strin
195195
}
196196

197197
$queueName = $this->getQueue($queue);
198-
$delayQueueName = $queueName . '.delay.' . $ttl;
198+
$delayQueueName = $queueName.'.delay.'.$ttl;
199199

200200
$this->declareDelayQueue($delayQueueName, $queueName, $ttl);
201201

@@ -260,7 +260,7 @@ public function pop($queue = null)
260260
} catch (AMQPConnectionException $exception) {
261261
// Replace with a more specific exception that Laravel's worker can detect as a lost connection
262262
throw new Exception(
263-
'Lost connection: ' . $exception->getMessage(),
263+
'Lost connection: '.$exception->getMessage(),
264264
$exception->getCode(),
265265
$exception
266266
);
@@ -357,7 +357,7 @@ public function declareQueue(
357357
}
358358

359359
$amqpQueue->declareQueue();
360-
} catch (AMQPChannelException | AMQPQueueException $exception) {
360+
} catch (AMQPChannelException|AMQPQueueException $exception) {
361361
// If it's not a "queue already exists" or "unknown delivery tag" case, re-throw
362362
if ($exception->getCode() !== self::QUEUE_ALREADY_EXISTS_CODE) {
363363
throw $exception;
@@ -418,7 +418,7 @@ public function reject(RabbitMQJob $rabbitMQJob, bool $requeue = false): void
418418
$amqpQueue = new AMQPQueue($this->getChannel());
419419
$amqpQueue->setName($rabbitMQJob->getQueue());
420420
$amqpQueue->reject($deliveryTag, $requeue ? AMQP_REQUEUE : AMQP_NOPARAM);
421-
} catch (AMQPChannelException | AMQPConnectionException $exception) {
421+
} catch (AMQPChannelException|AMQPConnectionException $exception) {
422422
// Reopen channel and try again
423423
$this->releaseChannel();
424424
$amqpQueue = new AMQPQueue($this->getChannel());
@@ -448,7 +448,7 @@ public function ack(RabbitMQJob $rabbitMQJob, int $maxRetries = self::MAX_RETRY_
448448
$amqpQueue->ack($deliveryTag);
449449

450450
return; // Acknowledgment successful
451-
} catch (AMQPChannelException | AMQPConnectionException $exception) {
451+
} catch (AMQPChannelException|AMQPConnectionException $exception) {
452452
// Recreate channel instead of setting to null
453453
$this->releaseChannel();
454454
$attempts++;
@@ -556,7 +556,7 @@ private function publishMessage(string $payload, string $queueName, int $attempt
556556

557557
try {
558558
return $this->doPublish($payload, $queueName, $messageAttributes);
559-
} catch (AMQPChannelException | AMQPConnectionException) {
559+
} catch (AMQPChannelException|AMQPConnectionException) {
560560
// Reopen channel and try again
561561
$this->releaseChannel();
562562

src/Support/ExchangeManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function setupDeadLetterExchange(
131131
$this->declareExchange($dlxName, $dlxType, true, false);
132132

133133
// Create dead letter queue
134-
$dlqName = $queueName . '.dlq';
134+
$dlqName = $queueName.'.dlq';
135135
$dlq = new AMQPQueue($this->channel);
136136
$dlq->setName($dlqName);
137137
$dlq->setFlags(AMQP_DURABLE);

src/Support/PublisherConfirms.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function enable(): void
3434
$this->channel->confirmSelect();
3535
$this->confirmMode = true;
3636
} catch (AMQPChannelException $e) {
37-
throw new Exception('Failed to enable publisher confirms: ' . $e->getMessage(), 0, $e);
37+
throw new Exception('Failed to enable publisher confirms: '.$e->getMessage(), 0, $e);
3838
}
3939
}
4040

@@ -58,9 +58,10 @@ public function waitForConfirms(): bool
5858
}
5959
try {
6060
$this->channel->waitForConfirm($this->timeout);
61+
6162
return true;
6263
} catch (AMQPChannelException $e) {
63-
throw new Exception('Failed to wait for confirms: ' . $e->getMessage(), 0, $e);
64+
throw new Exception('Failed to wait for confirms: '.$e->getMessage(), 0, $e);
6465
}
6566
}
6667

0 commit comments

Comments
 (0)