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.

DiffCommand   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 59
ccs 18
cts 18
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handle() 0 20 4
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 Illuminate\Console\Command;
11
use Jtant\LaravelEnvSync\Reader\ReaderInterface;
12
use Jtant\LaravelEnvSync\SyncService;
13
14
class DiffCommand extends BaseCommand
15
{
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'env:diff {--src=} {--dest=}';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'Show the difference between env files';
29
30
    /**
31
     * @var ReaderInterface
32
     */
33
    private $reader;
34
35
36
    /**
37
     * Create a new command instance.
38
     *
39
     * @param ReaderInterface $reader
40
     */
41 7
    public function __construct(ReaderInterface $reader)
42
    {
43 7
        parent::__construct();
44 7
        $this->reader = $reader;
45 7
    }
46
47
    /**
48
     * Execute the console command.
49
     *
50
     * @return mixed
51
     */
52 1
    public function handle()
53
    {
54 1
        list($src, $dest) = $this->getSrcAndDest();
55
56 1
        $envValues = $this->reader->read($dest);
57 1
        $exampleValues = $this->reader->read($src);
58
59 1
        $keys = array_unique(array_merge(array_keys($envValues), array_keys($exampleValues)));
60 1
        sort($keys);
61
62 1
        $header = ["Key", basename($dest), basename($src)];
63 1
        $lines = [];
64 1
        foreach ($keys as $key) {
65 1
            $envVal = isset($envValues[$key]) ? $envValues[$key] : '<error>NOT FOUND</error>';
66 1
            $exampleVal = isset($exampleValues[$key]) ? $exampleValues[$key] : '<error>NOT FOUND</error>';
67 1
            $lines[] = [$key, $envVal, $exampleVal];
68
        }
69
70 1
        $this->table($header, $lines);
71 1
    }
72
}
73