Code Duplication    Length = 17-19 lines in 2 locations

src/PhpGitHooks/Application/Composer/CommitMsgProcessor.php 1 location

@@ 28-44 (lines=17) @@
25
     *
26
     * @return bool
27
     */
28
    private function enableHook(array $configData)
29
    {
30
        if (!isset($configData[$this->hookName()])) {
31
            $enable = $this->setQuestion('Do you want enable commit-msg hook?', '[Y/n]', 'Y');
32
            $enabled = 'Y' === strtoupper($enable) ? true : false;
33
34
            $this->configData[$this->hookName()] = [
35
                'enabled' => $enabled,
36
            ];
37
38
            return $enabled;
39
        }
40
41
        $this->configData = $configData;
42
43
        return $configData[$this->hookName()]['enabled'];
44
    }
45
46
    private function setExpressionRegular()
47
    {

src/PhpGitHooks/Application/Composer/PreQualityToolProcessor.php 1 location

@@ 39-57 (lines=19) @@
36
     *
37
     * @return bool
38
     */
39
    protected function enableHook(array $configData)
40
    {
41
        if (!isset($configData[$this->hookName()])) {
42
            $enable = $this->setQuestion(sprintf('Do you want enable %s hook?', $this->hookName()), '[Y/n]', 'Y');
43
44
            $enabled = 'Y' === strtoupper($enable) ? true : false;
45
46
            $this->configData[$this->hookName()] = [
47
                'enabled' => $enabled,
48
                'execute' => [],
49
            ];
50
51
            return $enabled;
52
        }
53
54
        $this->configData = $configData;
55
56
        return $configData[$this->hookName()]['enabled'];
57
    }
58
59
    /**
60
     * @param array $execute