These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace SugaredRim\PHPUnit\TextUI; |
||
4 | |||
5 | use Schnittstabil\Get\Get; |
||
6 | |||
7 | View Code Duplication | class Command extends BaseCommand |
|
0 ignored issues
–
show
|
|||
8 | { |
||
9 | /** |
||
10 | * {@inheritdoc} |
||
11 | * |
||
12 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
13 | */ |
||
14 | public function handleArguments(array $argv) |
||
15 | { |
||
16 | parent::handleArguments($argv); |
||
17 | |||
18 | if (Get::value('sugaredDebug', $this->arguments, false)) { |
||
19 | $this->logDebug('Parsed arguments', $this->arguments); |
||
20 | } |
||
21 | |||
22 | $this->addListeners(); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | * |
||
28 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
29 | */ |
||
30 | public function run(array $argv, $exit = true) |
||
31 | { |
||
32 | $argv = $this->preprocessArgv($argv); |
||
33 | |||
34 | if (in_array('--sugared-debug', $argv)) { |
||
35 | $this->logDebug('Arguments', $argv); |
||
36 | } |
||
37 | |||
38 | return parent::run($argv, $exit); |
||
39 | } |
||
40 | } |
||
41 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.