GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

CheckCommand   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 66
ccs 20
cts 20
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
B handle() 0 27 5
1
<?php
2
/**
3
 * Laravel-Env-Sync
4
 *
5
 * @author Julien Tant - Craftyx <[email protected]>
6
 */
7
8
namespace Jtant\LaravelEnvSync\Console;
9
10
use Jtant\LaravelEnvSync\SyncService;
11
12
class CheckCommand extends BaseCommand
13
{
14
    /**
15
     * The name and signature of the console command.
16
     *
17
     * @var string
18
     */
19
    protected $signature = 'env:check {--src=} {--dest=} {--reverse}';
20
21
    /**
22
     * The console command description.
23
     *
24
     * @var string
25
     */
26
    protected $description = 'Check if your envs files are in sync';
27
28
    /**
29
     * @var SyncService
30
     */
31
    private $sync;
32
33
34
    /**
35
     * Create a new command instance.
36
     *
37
     * @param SyncService $sync
38
     */
39 7
    public function __construct(SyncService $sync)
40
    {
41 7
        parent::__construct();
42 7
        $this->sync = $sync;
43 7
    }
44
45
    /**
46
     * Execute the console command.
47
     *
48
     * @return mixed
49
     */
50 3
    public function handle()
51
    {
52 3
        list($src, $dest) = $this->getSrcAndDest();
53
54 3
        if ($this->option('reverse')) {
55 1
            $switch = $src;
56 1
            $src = $dest;
57 1
            $dest = $switch;
58 1
            unset($switch);
59
        }
60
61 3
        $diffs = $this->sync->getDiff($src, $dest);
62
63 3
        if (count($diffs) === 0) {
64 1
            $this->info(sprintf("Your %s file is already in sync with %s", basename($dest), basename($src)));
65 1
            return 0;
66
        }
67
68 2
        $this->info(sprintf("The following variables are not present in your %s file : ", basename($dest)));
69 2
        foreach ($diffs as $key => $diff) {
70 2
            $this->info(sprintf("\t- %s = %s", $key, $diff));
71
        }
72
73 2
        $this->info(sprintf("You can use `php artisan env:sync%s` to synchronise them", $this->option('reverse') ? ' --reverse' : ''));
74
75 2
        return 1;
76
    }
77
}
78