Code Duplication    Length = 19-19 lines in 2 locations

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

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

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) {