Code Duplication    Length = 13-16 lines in 2 locations

src/Roave/ComposerGpgVerify/Verify.php 2 locations

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