@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ComposerGpgVerify\Package; |
| 6 | 6 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | . implode( |
| 58 | 58 | "\n\n", |
| 59 | 59 | array_map( |
| 60 | - function (GitSignatureCheck $check) : string { |
|
| 60 | + function(GitSignatureCheck $check) : string { |
|
| 61 | 61 | return $check->asHumanReadableString(); |
| 62 | 62 | }, |
| 63 | 63 | $this->passedChecks() |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | . implode( |
| 71 | 71 | "\n\n", |
| 72 | 72 | array_map( |
| 73 | - function (GitSignatureCheck $check) : string { |
|
| 73 | + function(GitSignatureCheck $check) : string { |
|
| 74 | 74 | return $check->asHumanReadableString(); |
| 75 | 75 | }, |
| 76 | 76 | $this->failedChecks() |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | return array_values(array_filter( |
| 87 | 87 | $this->checks, |
| 88 | - function (GitSignatureCheck $check) { |
|
| 88 | + function(GitSignatureCheck $check) { |
|
| 89 | 89 | return $check->canBeTrusted(); |
| 90 | 90 | } |
| 91 | 91 | )); |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | return array_values(array_filter( |
| 100 | 100 | $this->checks, |
| 101 | - function (GitSignatureCheck $check) { |
|
| 102 | - return ! $check->canBeTrusted(); |
|
| 101 | + function(GitSignatureCheck $check) { |
|
| 102 | + return !$check->canBeTrusted(); |
|
| 103 | 103 | } |
| 104 | 104 | )); |
| 105 | 105 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ComposerGpgVerify\Package\Git; |
| 6 | 6 | |
@@ -68,15 +68,15 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | private function __construct( |
| 70 | 70 | string $packageName, |
| 71 | - ?string $commitHash, |
|
| 72 | - ?string $tagName, |
|
| 71 | + ? string $commitHash, |
|
| 72 | + ? string $tagName, |
|
| 73 | 73 | string $command, |
| 74 | 74 | int $exitCode, |
| 75 | 75 | string $output, |
| 76 | 76 | bool $isSigned, |
| 77 | 77 | bool $isVerified, |
| 78 | - ?string $signatureAuthor, |
|
| 79 | - ?string $signatureKey |
|
| 78 | + ? string $signatureAuthor, |
|
| 79 | + ? string $signatureKey |
|
| 80 | 80 | ) { |
| 81 | 81 | $this->packageName = $packageName; // @TODO get rid of this, or add it to the error messages |
| 82 | 82 | $this->commitHash = $commitHash; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | string $output |
| 98 | 98 | ) : self { |
| 99 | 99 | $signatureKey = self::extractKeyIdentifier($output); |
| 100 | - $signed = $signatureKey && ! $exitCode; |
|
| 100 | + $signed = $signatureKey && !$exitCode; |
|
| 101 | 101 | |
| 102 | 102 | return new self( |
| 103 | 103 | $package->getName(), |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | string $output |
| 121 | 121 | ) : self { |
| 122 | 122 | $signatureKey = self::extractKeyIdentifier($output); |
| 123 | - $signed = $signatureKey && ! $exitCode; |
|
| 123 | + $signed = $signatureKey && !$exitCode; |
|
| 124 | 124 | |
| 125 | 125 | return new self( |
| 126 | 126 | $package->getName(), |
@@ -142,14 +142,14 @@ discard block |
||
| 142 | 142 | "\n", |
| 143 | 143 | [ |
| 144 | 144 | (($this->isSigned || $this->signatureKey) ? '[SIGNED]' : '[NOT SIGNED]') |
| 145 | - . ' ' . ($this->isVerified ? '[VERIFIED]' : '[NOT VERIFIED]') |
|
| 146 | - . ' ' . ($this->commitHash ? 'Commit #' . $this->commitHash : '') |
|
| 147 | - . ' ' . ($this->tagName ? 'Tag ' . $this->tagName : '') |
|
| 148 | - . ' ' . ($this->signatureAuthor ? 'By "' . $this->signatureAuthor . '"' : '') |
|
| 149 | - . ' ' . ($this->signatureKey ? '(Key ' . $this->signatureKey . ')' : ''), |
|
| 150 | - 'Command: ' . $this->command, |
|
| 151 | - 'Exit code: ' . $this->exitCode, |
|
| 152 | - 'Output: ' . $this->output, |
|
| 145 | + . ' '.($this->isVerified ? '[VERIFIED]' : '[NOT VERIFIED]') |
|
| 146 | + . ' '.($this->commitHash ? 'Commit #'.$this->commitHash : '') |
|
| 147 | + . ' '.($this->tagName ? 'Tag '.$this->tagName : '') |
|
| 148 | + . ' '.($this->signatureAuthor ? 'By "'.$this->signatureAuthor.'"' : '') |
|
| 149 | + . ' '.($this->signatureKey ? '(Key '.$this->signatureKey.')' : ''), |
|
| 150 | + 'Command: '.$this->command, |
|
| 151 | + 'Exit code: '.$this->exitCode, |
|
| 152 | + 'Output: '.$this->output, |
|
| 153 | 153 | ] |
| 154 | 154 | ); |
| 155 | 155 | } |
@@ -159,10 +159,10 @@ discard block |
||
| 159 | 159 | return $this->isVerified; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - private static function extractCommitHash(string $output) : ?string |
|
| 162 | + private static function extractCommitHash(string $output) : ? string |
|
| 163 | 163 | { |
| 164 | 164 | $keys = array_filter(array_map( |
| 165 | - function (string $outputRow) { |
|
| 165 | + function(string $outputRow) { |
|
| 166 | 166 | preg_match('/^(tree|object) ([a-fA-F0-9]{40})$/i', $outputRow, $matches); |
| 167 | 167 | |
| 168 | 168 | return $matches[2] ?? false; |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | return reset($keys) ?: null; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - private static function extractTagName(string $output) : ?string |
|
| 176 | + private static function extractTagName(string $output) : ? string |
|
| 177 | 177 | { |
| 178 | 178 | $keys = array_filter(array_map( |
| 179 | - function (string $outputRow) { |
|
| 179 | + function(string $outputRow) { |
|
| 180 | 180 | preg_match('/^tag (.+)$/i', $outputRow, $matches); |
| 181 | 181 | |
| 182 | 182 | return $matches[1] ?? false; |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | return reset($keys) ?: null; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - private static function extractKeyIdentifier(string $output) : ?string |
|
| 190 | + private static function extractKeyIdentifier(string $output) : ? string |
|
| 191 | 191 | { |
| 192 | 192 | $keys = array_filter(array_map( |
| 193 | - function (string $outputRow) { |
|
| 193 | + function(string $outputRow) { |
|
| 194 | 194 | preg_match('/gpg:.*using .* key ([a-fA-F0-9]+)/i', $outputRow, $matches); |
| 195 | 195 | |
| 196 | 196 | return $matches[1] ?? false; |
@@ -201,10 +201,10 @@ discard block |
||
| 201 | 201 | return reset($keys) ?: null; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - private static function extractSignatureAuthor(string $output) : ?string |
|
| 204 | + private static function extractSignatureAuthor(string $output) : ? string |
|
| 205 | 205 | { |
| 206 | 206 | $keys = array_filter(array_map( |
| 207 | - function (string $outputRow) { |
|
| 207 | + function(string $outputRow) { |
|
| 208 | 208 | preg_match('/gpg: Good signature from "(.+)" \\[.*\\]/i', $outputRow, $matches); |
| 209 | 209 | |
| 210 | 210 | return $matches[1] ?? false; |
@@ -217,9 +217,9 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | private static function signatureValidationHasNoWarnings(string $output) : bool |
| 219 | 219 | { |
| 220 | - return ! array_filter( |
|
| 220 | + return !array_filter( |
|
| 221 | 221 | explode("\n", $output), |
| 222 | - function (string $outputRow) { |
|
| 222 | + function(string $outputRow) { |
|
| 223 | 223 | return false !== strpos($outputRow, 'gpg: WARNING: '); |
| 224 | 224 | } |
| 225 | 225 | ); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ComposerGpgVerify\Package; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace RoaveTest\ComposerGpgVerify\Package; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace RoaveTest\ComposerGpgVerify\Package\Git; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ComposerGpgVerify\Package; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace RoaveTest\ComposerGpgVerify\Package; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ComposerGpgVerify\Exception; |
| 6 | 6 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | implode( |
| 20 | 20 | "\n\n", |
| 21 | 21 | array_map( |
| 22 | - function (PackageVerification $failedVerification) : string { |
|
| 22 | + function(PackageVerification $failedVerification) : string { |
|
| 23 | 23 | return $failedVerification->printReason(); |
| 24 | 24 | }, |
| 25 | 25 | array_merge([$failedVerification], $furtherFailedVerifications) |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace RoaveTest\ComposerGpgVerify\Exception; |
| 6 | 6 | |