| Total Complexity | 5 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | trait DispatchesJobs |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Beautifier function to be called instead of the |
||
| 13 | * laravel function dispatch. |
||
| 14 | * |
||
| 15 | * @param mixed $job |
||
| 16 | * @param array|\Illuminate\Http\Request $arguments |
||
| 17 | * @param array $extra |
||
| 18 | * |
||
| 19 | * @return mixed |
||
| 20 | */ |
||
| 21 | 12 | public function run($job, $arguments = [], array $extra = []) |
|
| 22 | { |
||
| 23 | 12 | return $this->dispatch($this->prepare($job, $arguments, $extra)); |
|
|
|
|||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Runs the job in the given queue. |
||
| 28 | * |
||
| 29 | * @param string $job |
||
| 30 | * @param array|\Illuminate\Http\Request $arguments |
||
| 31 | * @param array $extra |
||
| 32 | * @param string $queue |
||
| 33 | * |
||
| 34 | * @return mixed |
||
| 35 | */ |
||
| 36 | 6 | public function runInQueue($job, $arguments = [], array $extra = [], string $queue = 'default') |
|
| 42 | } |
||
| 43 | |||
| 44 | |||
| 45 | /** |
||
| 46 | * Prepare a job by marshalling it if needed. |
||
| 47 | * |
||
| 48 | * @param $job |
||
| 49 | * @param $arguments |
||
| 50 | * @param array $extra |
||
| 51 | * @return mixed |
||
| 52 | */ |
||
| 53 | 18 | private function prepare($job, $arguments, array $extra) : Job |
|
| 64 | } |
||
| 65 | } |
||
| 66 |