Skip to content

Commit 6f4a280

Browse files
committed
Allows retrieval of retryUntil value
Allows retrieving the current retryUntil value when no arguments are passed to the retryUntil method. This is useful for inspecting the retryUntil value that has been set on a job.
1 parent 6820c75 commit 6f4a280

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Illuminate/Bus/Queueable.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,15 @@ public function retryWithDelay($delays)
236236
/**
237237
* Set the timestamp indicating when the job should timeout.
238238
*
239-
* @param \DateTimeInterface|int $datetime
240-
* @return $this
239+
* @param \DateTimeInterface|int|null $datetime
240+
* @return $this|\DateTimeInterface|int|null
241241
*/
242-
public function retryUntil($datetime)
242+
public function retryUntil($datetime = null)
243243
{
244+
if (func_num_args() === 0) {
245+
return $this->retryUntil;
246+
}
247+
244248
$this->retryUntil = $datetime;
245249

246250
return $this;

tests/Bus/QueueableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Carbon\Carbon;
66
use Illuminate\Bus\Queueable;
7-
use Illuminate\Queue\SyncQueue;
87
use Illuminate\Container\Container;
8+
use Illuminate\Queue\SyncQueue;
99
use PHPUnit\Framework\Attributes\DataProvider;
1010
use PHPUnit\Framework\TestCase;
1111

0 commit comments

Comments
 (0)