Completed
Pull Request — master (#72)
by D.
32:59 queued 30:14
created

Kernel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 90.91%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 39
ccs 10
cts 11
cp 0.9091
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A schedule() 0 16 2
1
<?php
2
3
namespace SET\Console;
4
5
use Illuminate\Console\Scheduling\Schedule;
6
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7
use SET\Console\Commands\ProcessMonday;
8
use SET\Console\Commands\RenewTraining;
9
use SET\Console\Commands\SendNews;
10
use SET\Console\Commands\SyncLdap;
11
use SET\Console\Commands\UpdateDuty;
12
13
class Kernel extends ConsoleKernel
14
{
15
    /**
16
     * The Artisan commands provided by your application.
17
     *
18
     * @var array
19
     */
20
    protected $commands = [
21
        UpdateDuty::class,
22
        ProcessMonday::class,
23
        SendNews::class,
24
        SyncLdap::class,
25
        RenewTraining::class,
26
    ];
27
28
    /**
29
     * Define the application's command schedule.
30
     *
31
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
32
     *
33
     * @return void
34
     */
35 162
    protected function schedule(Schedule $schedule)
36
    {
37 162
        $schedule->command('duty:update')->withoutOverlapping()
38 162
            ->daily()->at('6:00');
39 162
        $schedule->command('emails:monday')->withoutOverlapping()
40 162
            ->weekly()->mondays()->at('6:01');
41 162
        $schedule->command('emails:news')->withoutOverlapping()
42 162
            ->daily()->at('6:00');
43
44
        //clear activitylog entries
45 162
        $schedule->command('activitylog:clean')->daily();
46
47 162
        if (config('auth.providers.users.driver') == 'adldap') {
48
            $schedule->command('users:sync')->withoutOverlapping()->hourly();
49
        }
50 162
    }
51
}
52