QueueableJob.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Facade\Ignition\Tests\stubs\jobs;
  3. use Carbon\CarbonImmutable;
  4. use Exception;
  5. use Illuminate\Bus\Queueable;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Foundation\Bus\Dispatchable;
  8. use Illuminate\Queue\InteractsWithQueue;
  9. use Illuminate\Queue\SerializesModels;
  10. class QueueableJob implements ShouldQueue
  11. {
  12. use Dispatchable;
  13. use InteractsWithQueue;
  14. use Queueable;
  15. use SerializesModels;
  16. /** @var array */
  17. private $property;
  18. private string $uninitializedProperty;
  19. public function __construct(
  20. array $property,
  21. ?CarbonImmutable $retryUntilValue = null,
  22. ?int $tries = null,
  23. ?int $maxExceptions = null,
  24. ?int $timeout = null
  25. ) {
  26. $this->property = $property;
  27. $this->retryUntilValue = $retryUntilValue;
  28. $this->tries = $tries;
  29. $this->maxExceptions = $maxExceptions;
  30. $this->timeout = $timeout;
  31. }
  32. /**
  33. * Execute the job.
  34. *
  35. * @return void
  36. */
  37. public function handle()
  38. {
  39. throw new Exception("Die");
  40. }
  41. public function retryUntil()
  42. {
  43. return $this->retryUntilValue;
  44. }
  45. }