Passed
Pull Request — master (#209)
by
unknown
10:30
created

Kernel::schedule()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * Application Console Kernel.
4
 *
5
 * @package App\Console
6
 *
7
 * @author    Taylor Otwell <[email protected]>
8
 * @author    Nick Menke <[email protected]>
9
 * @copyright 2018-2020 Nick Menke
10
 *
11
 * @link https://github.com/nlmenke/vertebrae
12
 */
13
14
declare(strict_types=1);
15
16
namespace App\Console;
17
18
use App\Console\Commands\BuildPageFiles\BuildPageFilesCommand;
19
use App\Jobs\UpdateExchangeRates;
20
use Illuminate\Console\Scheduling\Schedule;
21
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
22
23
/**
24
 * The console kernel class.
25
 *
26
 * The console kernel is responsible for registering commands for use and
27
 * scheduling various commands and tasks.
28
 *
29
 * @since 0.0.0-framework introduced
30
 * @since x.x.x           skeleton commands/jobs
31
 */
32
class Kernel extends ConsoleKernel
33
{
34
    /**
35
     * The Artisan commands provided by your application.
36
     *
37
     * @var array
38
     */
39
    protected $commands = [
40
        BuildPageFilesCommand::class,
41
    ];
42
43
    /**
44
     * Register the commands for the application.
45
     *
46
     * @return void
47
     */
48 33
    protected function commands(): void
49
    {
50 33
        $this->load(__DIR__ . '/Commands');
51
52 33
        require base_path('routes/console.php');
53
    }
54
55
    /**
56
     * Define the application's command schedule.
57
     *
58
     * @param Schedule $schedule
59
     *
60
     * @return void
61
     */
62
    protected function schedule(Schedule $schedule): void
63
    {
64
        $schedule->job(new UpdateExchangeRates())->quarterly();
65
    }
66
}
67