ScheduleSummary::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php namespace Indatus\Dispatcher\Commands;
2
3
/**
4
 * This file is part of Dispatcher
5
 *
6
 * (c) Ben Kuhl <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
use Illuminate\Console\Command;
13
use Indatus\Dispatcher\Services\ScheduleService;
14
15
/**
16
 * View a summary for all scheduled artisan commands
17
 * @author Ben Kuhl <[email protected]>
18
 * @package Indatus\Dispatcher\Commands
19
 */
20
class ScheduleSummary extends Command
21
{
22
    /** @var \Indatus\Dispatcher\Services\ScheduleService|null  */
23
    private $scheduleService = null;
24
25 3
    public function __construct(ScheduleService $scheduleService)
26
    {
27 3
        parent::__construct();
28
29 3
        $this->scheduleService = $scheduleService;
30 3
    }
31
32
    /**
33
     * The console command name.
34
     *
35
     * @var string
36
     */
37
    protected $name = 'scheduled:summary';
38
39
    /**
40
     * The console command description.
41
     *
42
     * @var string
43
     */
44
    protected $description = 'View a summary of all scheduled artisan commands';
45
46
    /**
47
     * Execute the console command.
48
     *
49
     * @return mixed
50
     */
51 1
    public function fire()
52
    {
53 1
        $this->scheduleService->printSummary();
54 1
    }
55
}
56