Skip to content

Commit

Permalink
[11.x] Added attempts() method to FakeJob (#51951)
Browse files Browse the repository at this point in the history
* Added attempts() method to FakeJob

* Update FakeJob.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
JamesFreeman and taylorotwell authored Jun 28, 2024
1 parent b8fa132 commit 85da360
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Illuminate/Queue/Jobs/FakeJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class FakeJob extends Job
*/
public $releaseDelay;

/**
* The number of attempts made to process the job.
*
* @var int
*/
public $attempts = 1;

/**
* The exception the job failed with.
*
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 85da360

Please sign in to comment.