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 ebedf5f

Browse files
authored
Merge pull request #991 from snapshotpl/php74
Add php 7.4 to test matrix
2 parents a5bf0aa + 31a981a commit ebedf5f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎PheanstalkConsumer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ public function reject(Message $message, bool $requeue = false): void
9191
InvalidMessageException::assertMessageInstanceOf($message, PheanstalkMessage::class);
9292

9393
if (false == $message->getJob()) {
94-
throw new \LogicException(sprintf(
95-
'The message could not be %s because it does not have job set.',
96-
$requeue ? 'requeued' : 'rejected'
97-
));
94+
$state = $requeue ? 'requeued' : 'rejected';
95+
throw new \LogicException(sprintf('The message could not be %s because it does not have job set.', $state));
9896
}
9997

10098
if ($requeue) {
@@ -111,7 +109,9 @@ private function convertJobToMessage(Job $job): PheanstalkMessage
111109
$stats = $this->pheanstalk->statsJob($job);
112110

113111
$message = PheanstalkMessage::jsonUnserialize($job->getData());
114-
$message->setRedelivered($stats['reserves'] > 1);
112+
if (isset($stats['reserves'])) {
113+
$message->setRedelivered($stats['reserves'] > 1);
114+
}
115115
$message->setJob($job);
116116

117117
return $message;

0 commit comments

Comments
(0)

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