Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| DeleteInstancyGroupEventListener | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| handle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Listeners; |
| 4 | |
| 5 | use App\Events\DeleteInstancyGroup; |
| 6 | use App\Http\Repositories\InstancyRepository; |
| 7 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 8 | use Illuminate\Support\Facades\Log; |
| 9 | |
| 10 | class DeleteInstancyGroupEventListener implements ShouldQueue |
| 11 | { |
| 12 | /** |
| 13 | * The number of seconds before the job should be processed. |
| 14 | * |
| 15 | * @var int |
| 16 | */ |
| 17 | public $delay = 1; |
| 18 | |
| 19 | protected $instancyRepository; |
| 20 | |
| 21 | /** |
| 22 | * Create the event listener. |
| 23 | */ |
| 24 | public function __construct(InstancyRepository $instancyRepository) |
| 25 | { |
| 26 | $this->instancyRepository = $instancyRepository; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Handle the event. |
| 31 | */ |
| 32 | public function handle(DeleteInstancyGroup $event) |
| 33 | { |
| 34 | // log the event |
| 35 | $this->instancyRepository->deleteGroup($event->groupInstancyId); |
| 36 | } |
| 37 | } |