Skip to content

Commit 85da360

Browse files
[11.x] Added attempts() method to FakeJob (#51951)
* Added attempts() method to FakeJob * Update FakeJob.php --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent b8fa132 commit 85da360

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Illuminate/Queue/Jobs/FakeJob.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ class FakeJob extends Job
1313
*/
1414
public $releaseDelay;
1515

16+
/**
17+
* The number of attempts made to process the job.
18+
*
19+
* @var int
20+
*/
21+
public $attempts = 1;
22+
1623
/**
1724
* The exception the job failed with.
1825
*
@@ -52,6 +59,16 @@ public function release($delay = 0)
5259
$this->releaseDelay = $delay;
5360
}
5461

62+
/**
63+
* Get the number of times the job has been attempted.
64+
*
65+
* @return int
66+
*/
67+
public function attempts()
68+
{
69+
return $this->attempts;
70+
}
71+
5572
/**
5673
* Delete the job from the queue.
5774
*

0 commit comments

Comments
 (0)