From 440a13955ff9d4df44b8cbe716a8775784d94d86 Mon Sep 17 00:00:00 2001 From: James Freeman Date: Fri, 28 Jun 2024 10:39:21 +0100 Subject: [PATCH 1/2] Added attempts() method to FakeJob --- src/Illuminate/Queue/Jobs/FakeJob.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Illuminate/Queue/Jobs/FakeJob.php b/src/Illuminate/Queue/Jobs/FakeJob.php index 8866afda072f..c4bda6f5c42c 100644 --- a/src/Illuminate/Queue/Jobs/FakeJob.php +++ b/src/Illuminate/Queue/Jobs/FakeJob.php @@ -20,6 +20,13 @@ class FakeJob extends Job */ public $failedWith; + /** + * The number of attempts made to process the job. + * + * @var int + */ + public $attempts = 1; + /** * Get the job identifier. * @@ -52,6 +59,16 @@ public function release($delay = 0) $this->releaseDelay = $delay; } + /** + * Get the number of times the job has been attempted. + * + * @return int + */ + public function attempts() + { + return $this->attempts; + } + /** * Delete the job from the queue. * From 703f70baf0dc52cd0e67e495f9c85682815ab8b1 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 28 Jun 2024 22:08:40 +0200 Subject: [PATCH 2/2] Update FakeJob.php --- src/Illuminate/Queue/Jobs/FakeJob.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/Queue/Jobs/FakeJob.php b/src/Illuminate/Queue/Jobs/FakeJob.php index c4bda6f5c42c..ef1d4e8bc04a 100644 --- a/src/Illuminate/Queue/Jobs/FakeJob.php +++ b/src/Illuminate/Queue/Jobs/FakeJob.php @@ -14,18 +14,18 @@ class FakeJob extends Job public $releaseDelay; /** - * The exception the job failed with. + * The number of attempts made to process the job. * - * @var \Throwable + * @var int */ - public $failedWith; + public $attempts = 1; /** - * The number of attempts made to process the job. + * The exception the job failed with. * - * @var int + * @var \Throwable */ - public $attempts = 1; + public $failedWith; /** * Get the job identifier.