Code Duplication    Length = 34-34 lines in 2 locations

Command6.php 1 location

@@ 7-40 (lines=34) @@
4
5
use Schnittstabil\Get\Get;
6
7
class Command extends BaseCommand
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

Command7.php 1 location

@@ 7-40 (lines=34) @@
4
5
use Schnittstabil\Get\Get;
6
7
class Command extends BaseCommand
8
{
9
    /**
10
     * {@inheritdoc}
11
     *
12
     * @SuppressWarnings(PHPMD.StaticAccess)
13
     */
14
    public function handleArguments(array $argv): void
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): int
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