IproPullDatabaseCommand::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 27
ccs 0
cts 24
cp 0
crap 2
rs 9.7333
c 0
b 0
f 0
1
<?php
2
3
namespace IproSync\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Artisan;
7
8
class IproPullDatabaseCommand extends Command
9
{
10
    protected $signature = 'iprosoftware-sync:database:pull
11
     {--queue= : Queue to dispatch job.}
12
     ';
13
14
    protected $description = 'Pull ipro fully data';
15
16
    public function handle(): int
17
    {
18
        $queue = $this->option('queue');
19
20
        Artisan::call('iprosoftware-sync:settings:pull', array_filter([
21
            '--queue' => $queue,
22
        ]));
23
        Artisan::call('iprosoftware-sync:contacts:pull', array_filter([
24
            '--queue' => $queue,
25
        ]));
26
        Artisan::call('iprosoftware-sync:properties:pull', array_filter([
27
            '--queue' => $queue,
28
        ]));
29
        Artisan::call('iprosoftware-sync:properties-custom-rates:pull', array_filter([
30
            '--queue' => $queue,
31
        ]));
32
        Artisan::call('iprosoftware-sync:availability:pull', array_filter([
33
            '--queue' => $queue,
34
        ]));
35
        Artisan::call('iprosoftware-sync:blockouts:pull', array_filter([
36
            '--queue' => $queue,
37
        ]));
38
        Artisan::call('iprosoftware-sync:bookings:pull', array_filter([
39
            '--queue' => $queue,
40
        ]));
41
42
        return 0;
43
    }
44
}
45