Kernel::commands()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Console;
4
5
use App\Console\Commands\DemoCommand;
6
use App\Console\Commands\InstallCommand;
7
use Illuminate\Console\Scheduling\Schedule;
8
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
9
10
class Kernel extends ConsoleKernel
11
{
12
    /**
13
     * The Artisan commands provided by your application.
14
     *
15
     * @var array
16
     */
17
    protected $commands = [
18
        InstallCommand::class,
19
        DemoCommand::class,
20
    ];
21
22
    /**
23
     * Define the application's command schedule.
24
     *
25
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
26
     *
27
     * @return void
28
     */
29
    protected function schedule(Schedule $schedule)
30
    {
31
        if (config('queue.type') == 'schedule') {
0 ignored issues
show
Bug introduced by
The call to config() has too few arguments starting with default. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
        if (/** @scrutinizer ignore-call */ config('queue.type') == 'schedule') {

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
32
            $schedule->command('queue:work')
33
                ->everyMinute();
34
        }
35
    }
36
37
    /**
38
     * Register the Closure based commands for the application.
39
     *
40
     * @return void
41
     */
42
    protected function commands()
43
    {
44
        $this->load(__DIR__.'/Commands');
45
        require base_path('routes/console.php');
46
    }
47
}
48