Passed
Pull Request — stable (#242)
by Sven
03:36
created

Command   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 38
ccs 5
cts 7
cp 0.7143
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 1
A schedule() 0 3 1
A setLaravel() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of Laravel Zero.
5
 *
6
 * (c) Nuno Maduro <[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
namespace LaravelZero\Framework\Commands;
13
14
use LogicException;
15
use Illuminate\Console\Scheduling\Schedule;
16
use Illuminate\Console\Command as BaseCommand;
17
18
/**
19
 * This is the Laravel Zero Framework Abstract Command Implementation.
20
 */
21
abstract class Command extends BaseCommand
22
{
23
    /**
24
     * Holds an instance of the app, if any.
25
     *
26
     * @var \Illuminate\Contracts\Foundation\Application|null
27
     */
28
    protected $app;
29
30
    /**
31
     * Execute the console command.
32
     *
33
     * @return void
34
     */
35
    public function handle(): void
36
    {
37
        throw new LogicException('You must override the handle() method in the concrete command class.');
38
    }
39
40
    /**
41
     * Define the command's schedule.
42
     *
43
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
44
     *
45
     * @return void
46
     */
47 20
    public function schedule(Schedule $schedule): void
0 ignored issues
show
Unused Code introduced by
The parameter $schedule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
48
    {
49 20
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54 20
    public function setLaravel($laravel)
55
    {
56 20
        parent::setLaravel($this->app = $laravel);
57 20
    }
58
}
59