Conditions | 8 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 8 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
72 | 8 | public function parse(Args $args) |
|
73 | { |
||
74 | 8 | $errorKeep = $args->hasOption('error-keep'); |
|
75 | |||
76 | 8 | $keep = $args->hasOption('keep'); |
|
77 | |||
78 | 8 | $noKeep = $args->hasOption('no-keep'); |
|
79 | |||
80 | 8 | if ($keep && $noKeep) { |
|
81 | 1 | throw new StatusException('--keep and --no-keep are exclusive', 1); |
|
82 | } |
||
83 | |||
84 | 7 | if ($keep && $errorKeep) { |
|
85 | 1 | throw new StatusException('--keep and --error-keep are exclusive', 1); |
|
86 | } |
||
87 | |||
88 | 6 | if ($noKeep && $errorKeep) { |
|
89 | 1 | throw new StatusException('--error-keep and --no-keep are exclusive', 1); |
|
90 | } |
||
91 | |||
92 | 5 | return array($errorKeep, $keep && !$noKeep); |
|
93 | } |
||
103 |