Code Duplication    Length = 13-16 lines in 2 locations

src/Roave/ComposerGpgVerify/Verify.php 2 locations

@@ 120-132 (lines=13) @@
117
        );
118
    }
119
120
    private static function checkCurrentCommitSignature(
121
        string $gitDirectory,
122
        PackageInterface $package
123
    ) : GitSignatureCheck {
124
        $command = sprintf(
125
            'git --git-dir %s verify-commit --verbose HEAD 2>&1',
126
            escapeshellarg($gitDirectory)
127
        );
128
129
        exec($command, $output, $exitCode);
130
131
        return GitSignatureCheck::fromGitCommitCheck($package, $command, $exitCode, implode("\n", $output));
132
    }
133
134
    /**
135
     * @param string $gitDirectory
@@ 163-178 (lines=16) @@
160
    private static function checkTagSignatures(string $gitDirectory, PackageInterface $package, string ...$tags) : array
161
    {
162
        return array_map(
163
            function (string $tag) use ($gitDirectory, $package) : GitSignatureCheck {
164
                $command = sprintf(
165
                    'git --git-dir %s tag -v %s 2>&1',
166
                    escapeshellarg($gitDirectory),
167
                    escapeshellarg($tag)
168
                );
169
170
                exec($command, $tagSignatureOutput, $exitCode);
171
172
                return GitSignatureCheck::fromGitTagCheck(
173
                    $package,
174
                    $command,
175
                    $exitCode,
176
                    implode("\n", $tagSignatureOutput)
177
                );
178
            },
179
            $tags
180
        );
181
    }