| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function handle(): void |
||
| 23 | { |
||
| 24 | $this->data->logger?->info("Job {$this->data->id} started."); |
||
| 25 | |||
| 26 | $result = OptimizePdfAction::init($this->data->file, $this->data->disk) |
||
| 27 | ->logger($this->data->logger) |
||
| 28 | ->setTimeout($this->data->timeout) |
||
| 29 | ->execute( |
||
| 30 | $this->data->commands, |
||
| 31 | $this->data->input, |
||
| 32 | $this->data->output |
||
| 33 | ); |
||
| 34 | |||
| 35 | event( |
||
| 36 | new PdfOptimizerJobFinished($this->data->id, $result->status, $result->message) |
||
| 37 | ); |
||
| 38 | |||
| 39 | if ($result->status) { |
||
| 40 | $this->data->logger?->info('Job finished successfully.'); |
||
| 41 | } |
||
| 42 | else { |
||
| 43 | $this->data->logger?->error('Job finished with error.'); |
||
| 44 | |||
| 45 | $this->fail($result->message); |
||
| 46 | } |
||
| 49 |