SendEmailsExpiringRepetitiveEvents   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 40
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 6 1
1
<?php
2
3
namespace App\Console\Commands;
4
5
use App\Services\EventService;
6
use Illuminate\Console\Command;
7
8
class SendEmailsExpiringRepetitiveEvents extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'mail:sendEmailToExpiringEventsOrganizers';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Send an email to the organizers of repetitive events that expire in one week from today.';
23
24
    private EventService $eventService;
25
26
    /**
27
     * Create a new command instance.
28
     *
29
     * @param \App\Services\EventService $eventService
30
     */
31
    public function __construct(EventService $eventService)
32
    {
33
        parent::__construct();
34
        $this->eventService = $eventService;
35
    }
36
37
    /**
38
     * Execute the console command.
39
     *
40
     * @return int
41
     */
42
    public function handle()
43
    {
44
        $output = $this->eventService->sendEmailToExpiringEventsOrganizers();
45
        $this->info($output); // Write output to console.
46
47
        return 0;
48
    }
49
}
50