Code Duplication    Length = 19-19 lines in 2 locations

src/PhpGitHooks/Infrastructure/PhpMD/PhpMDHandler.php 1 location

@@ 55-73 (lines=19) @@
52
                continue;
53
            }
54
55
            if (false === $this->ignoreFiles->isIgnored($file)) {
56
                $processBuilder = new ProcessBuilder(
57
                    array(
58
                        'php',
59
                        'bin/phpmd',
60
                        $file,
61
                        'text',
62
                        'PmdRules.xml',
63
                        '--minimumpriority',
64
                        1,
65
                    )
66
                );
67
                $process = $processBuilder->getProcess();
68
                $process->run();
69
70
                if (false === $process->isSuccessful()) {
71
                    $errors[] = $process->getOutput();
72
                }
73
            }
74
        }
75
76
        $errors = array_filter($errors, function ($var) {

src/PhpGitHooks/Infrastructure/PhpCsFixer/PhpCsFixerHandler.php 1 location

@@ 57-75 (lines=19) @@
54
                        continue;
55
                    }
56
57
                    if (false === $this->ignoreFiles->isIgnored($file)) {
58
                        $processBuilder = new ProcessBuilder(
59
                            array(
60
                                'php',
61
                                'bin/php-cs-fixer',
62
                                '--dry-run',
63
                                'fix',
64
                                $file,
65
                                '--level='.$level,
66
                            )
67
                        );
68
69
                        $phpCsFixer = $processBuilder->getProcess();
70
                        $phpCsFixer->run();
71
72
                        if (false === $phpCsFixer->isSuccessful()) {
73
                            $errors[] = $phpCsFixer->getOutput();
74
                        }
75
                    }
76
                }
77
78
                if ($errors) {