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.
Completed
Push — master ( 430bb8...dc0110 )
by Julien
01:23
created

BaseCommand   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 62.5%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 21
ccs 5
cts 8
cp 0.625
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getSrcAndDest() 0 14 7
1
<?php
2
/**
3
 * Laravel-Env-Sync
4
 *
5
 * @author Julien Tant - Craftyx <[email protected]>
6
 */
7
8
namespace Jtant\LaravelEnvSync\Console;
9
10
11
use Illuminate\Console\Command;
12
13
class BaseCommand extends Command
14
{
15
16
    /**
17
     * @return array
18
     */
19 6
    public function getSrcAndDest()
20
    {
21 6
        if ($this->option('src') != null || $this->option('dest') != null) {
22
            if ($this->option('src') == null || $this->option('dest') == null) {
23
                $this->error("You must use either both src and dest options, or none.");
24
                exit(1);
0 ignored issues
show
Coding Style Compatibility introduced by
The method getSrcAndDest() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
25
            }
26
        }
27
28 6
        $src = $this->option('src') ? $this->option('src') : base_path('.env.example');
29 6
        $dest = $this->option('dest') ? $this->option('dest') : base_path('.env');
30
31 6
        return array($src, $dest);
32
    }
33
}