Conditions | 7 |
Paths | 9 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 9.5839 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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); |
||
|
|||
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 | } |
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.