Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
UpdateUserEmail | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
handle | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace App\Jobs\Instancy; |
4 | |
5 | use App\Http\Repositories\InstancyRepository; |
6 | use Illuminate\Bus\Queueable; |
7 | use Illuminate\Contracts\Queue\ShouldQueue; |
8 | use Illuminate\Foundation\Bus\Dispatchable; |
9 | use Illuminate\Queue\InteractsWithQueue; |
10 | use Illuminate\Queue\SerializesModels; |
11 | use Illuminate\Support\Facades\Log; |
12 | |
13 | class UpdateUserEmail implements ShouldQueue |
14 | { |
15 | use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
16 | |
17 | public $tries = 3; |
18 | public $retryAfter = 60; |
19 | |
20 | /** |
21 | * Create a new job instance. |
22 | */ |
23 | public function __construct( |
24 | private readonly stdClass $instancyDTO |
25 | ) { |
26 | } |
27 | |
28 | /** |
29 | * Execute the job. |
30 | */ |
31 | public function handle(): void |
32 | { |
33 | try { |
34 | $instancyRepository = new InstancyRepository(); |
35 | |
36 | $instancyRepository->updateUserEmail($this->instancyDTO); |
37 | } catch (\Exception $e) { |
38 | Log::error('Error sending email: ' . $e->getMessage()); |
39 | } |
40 | } |
41 | } |