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::getSrcAndDest()   B

Complexity

Conditions 7
Paths 9

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 9.5839

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
ccs 5
cts 8
cp 0.625
rs 8.2222
cc 7
eloc 8
nc 9
nop 0
crap 9.5839
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
}