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