Sync   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 37
ccs 0
cts 15
cp 0
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 20 4
1
<?php
2
3
namespace Distilleries\Contentful\Commands\Sync;
4
5
use Illuminate\Console\Command;
6
7
class Sync extends Command
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    protected $signature = 'contentful:sync {--preview} {--no-switch} {--no-truncate}';
13
14
    /**
15
     * {@inheritdoc}
16
     */
17
    protected $description = 'Synchronize Contentful process (locales, raw fetch, map and persist)';
18
19
    /**
20
     * Execute the console command.
21
     *
22
     * @return void
23
     */
24
    public function handle()
25
    {
26
        $arguments = [];
27
        if ($this->option('preview')) {
28
            $arguments['--preview'] = true;
29
        }
30
31
        $this->call('contentful:sync-locales', $arguments);
32
33
        $this->call('contentful:sync-data', $arguments);
34
35
        if ($this->option('no-switch')) {
36
            $arguments['--no-switch'] = true;
37
        }
38
39
        if ($this->option('no-truncate')) {
40
            $arguments['--no-truncate'] = true;
41
        }
42
43
        $this->call('contentful:sync-flatten', $arguments);
44
    }
45
}
46