Code Duplication    Length = 13-16 lines in 2 locations

src/Roave/ComposerGpgVerify/Verify.php 2 locations

@@ 103-115 (lines=13) @@
100
        );
101
    }
102
103
    private static function checkCurrentCommitSignature(
104
        string $gitDirectory,
105
        PackageInterface $package
106
    ) : GitSignatureCheck {
107
        $command = sprintf(
108
            'git --git-dir %s verify-commit --verbose HEAD 2>&1',
109
            escapeshellarg($gitDirectory)
110
        );
111
112
        exec($command, $output, $exitCode);
113
114
        return GitSignatureCheck::fromGitCommitCheck($package, $command, $exitCode, implode("\n", $output));
115
    }
116
117
    /**
118
     * @param string $gitDirectory
@@ 146-161 (lines=16) @@
143
    private static function checkTagSignatures(string $gitDirectory, PackageInterface $package, string ...$tags) : array
144
    {
145
        return array_map(
146
            function (string $tag) use ($gitDirectory, $package) : GitSignatureCheck {
147
                $command = sprintf(
148
                    'git --git-dir %s tag -v %s 2>&1',
149
                    escapeshellarg($gitDirectory),
150
                    escapeshellarg($tag)
151
                );
152
153
                exec($command, $tagSignatureOutput, $exitCode);
154
155
                return GitSignatureCheck::fromGitTagCheck(
156
                    $package,
157
                    $command,
158
                    $exitCode,
159
                    implode("\n", $tagSignatureOutput)
160
                );
161
            },
162
            $tags
163
        );
164
    }