![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/vendor/laravel/framework/src/Illuminate/Queue/ |
<?php namespace Illuminate\Queue; use Illuminate\Contracts\Queue\Job as JobContract; use InvalidArgumentException; use Throwable; trait InteractsWithQueue { /** * The underlying queue job instance. * * @var \Illuminate\Contracts\Queue\Job|null */ public $job; /** * Get the number of times the job has been attempted. * * @return int */ public function attempts() { return $this->job ? $this->job->attempts() : 1; } /** * Delete the job from the queue. * * @return void */ public function delete() { if ($this->job) { return $this->job->delete(); } } /** * Fail the job from the queue. * * @param \Throwable|string|null $exception * @return void */ public function fail($exception = null) { if (is_string($exception)) { $exception = new ManuallyFailedException($exception); } if ($exception instanceof Throwable || is_null($exception)) { if ($this->job) { return $this->job->fail($exception); } } else { throw new InvalidArgumentException('The fail method requires a string or an instance of Throwable.'); } } /** * Release the job back into the queue after (n) seconds. * * @param int $delay * @return void */ public function release($delay = 0) { if ($this->job) { return $this->job->release($delay); } } /** * Set the base queue job instance. * * @param \Illuminate\Contracts\Queue\Job $job * @return $this */ public function setJob(JobContract $job) { $this->job = $job; return $this; } }