@@ -55,6 +55,9 @@ |
||
| 55 | 55 | EOT; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | + /** |
|
| 59 | + * @param string $event_name |
|
| 60 | + */ |
|
| 58 | 61 | protected function getEntry($event_name, $args, $params, $response) |
| 59 | 62 | { |
| 60 | 63 | $args_string = json_encode($args); |
@@ -36,6 +36,9 @@ discard block |
||
| 36 | 36 | $this->eventLogger = null; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $as |
|
| 41 | + */ |
|
| 39 | 42 | public function setAs($as) |
| 40 | 43 | { |
| 41 | 44 | if ($as != $this->as) { |
@@ -122,6 +125,9 @@ discard block |
||
| 122 | 125 | return [$status, $existingPRs]; |
| 123 | 126 | } |
| 124 | 127 | |
| 128 | + /** |
|
| 129 | + * @param string $number |
|
| 130 | + */ |
|
| 125 | 131 | public function prStatuses($projectWithOrg, $number) |
| 126 | 132 | { |
| 127 | 133 | list($org, $project) = explode('/', $projectWithOrg, 2); |
@@ -141,6 +147,10 @@ discard block |
||
| 141 | 147 | uasort( |
| 142 | 148 | |
| 143 | 149 | $pullRequestStatus, |
| 150 | + |
|
| 151 | + /** |
|
| 152 | + * @param string $rhs |
|
| 153 | + */ |
|
| 144 | 154 | function ($lhs, $rhs) { |
| 145 | 155 | return abs(strtotime($lhs['updated_at']) - strtotime($rhs['updated_at'])); |
| 146 | 156 | } |
@@ -171,11 +181,17 @@ discard block |
||
| 171 | 181 | return $remote; |
| 172 | 182 | } |
| 173 | 183 | |
| 184 | + /** |
|
| 185 | + * @param string $projectWithOrg |
|
| 186 | + */ |
|
| 174 | 187 | protected function existingPRs($projectWithOrg, VersionIdentifiers $vids) |
| 175 | 188 | { |
| 176 | 189 | return $this->matchingPRs($projectWithOrg, $vids->getPreamble(), $vids->pattern()); |
| 177 | 190 | } |
| 178 | 191 | |
| 192 | + /** |
|
| 193 | + * @param string $preamble |
|
| 194 | + */ |
|
| 179 | 195 | public function matchingPRs($projectWithOrg, $preamble, $pattern = '') |
| 180 | 196 | { |
| 181 | 197 | $q = "repo:$projectWithOrg in:title is:pr state:open $preamble"; |
@@ -194,6 +194,9 @@ discard block |
||
| 194 | 194 | return $this->getProjectWithOrfFromUrl($remote); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | + /** |
|
| 198 | + * @param string $remote |
|
| 199 | + */ |
|
| 197 | 200 | protected function getProjectWithOrfFromUrl($remote) |
| 198 | 201 | { |
| 199 | 202 | $remote = preg_replace('#^git@[^:]*:#', '', $remote); |
@@ -251,7 +254,7 @@ discard block |
||
| 251 | 254 | * _links: Links |
| 252 | 255 | * @default-fields number,user,title |
| 253 | 256 | * @default-string-field number |
| 254 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
| 257 | + * @return RowsOfFields |
|
| 255 | 258 | */ |
| 256 | 259 | public function prFind($projectWithOrg = '', $options = ['as' => 'default', 'format' => 'yaml', 'q' => '']) |
| 257 | 260 | { |
@@ -311,7 +314,7 @@ discard block |
||
| 311 | 314 | * @default-fields full_name,language,default_branch |
| 312 | 315 | * @default-string-field full_name |
| 313 | 316 | * |
| 314 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
| 317 | + * @return RowsOfFields |
|
| 315 | 318 | */ |
| 316 | 319 | public function orgRepos($org, $options = ['as' => 'default', 'format' => 'table']) |
| 317 | 320 | { |
@@ -362,7 +365,7 @@ discard block |
||
| 362 | 365 | * license: License |
| 363 | 366 | * permissions: Permissions |
| 364 | 367 | * |
| 365 | - * @return Consolidation\OutputFormatters\StructuredData\PropertyList |
|
| 368 | + * @return PropertyList |
|
| 366 | 369 | */ |
| 367 | 370 | public function repoInfo($projectWithOrg = '', $options = ['as' => 'default', 'format' => 'table']) |
| 368 | 371 | { |
@@ -426,6 +429,9 @@ discard block |
||
| 426 | 429 | $this->logger->notice("Set default branch to {new}.", ['new' => $newDefault]); |
| 427 | 430 | } |
| 428 | 431 | |
| 432 | + /** |
|
| 433 | + * @param WorkingCopy $workingCopy |
|
| 434 | + */ |
|
| 429 | 435 | protected function configureDefaultWithWorkingCopy($workingCopy, $currentDefault, $newDefault, $currentHeadSha) |
| 430 | 436 | { |
| 431 | 437 | $statusResult = $workingCopy->status(); |
@@ -503,7 +509,7 @@ discard block |
||
| 503 | 509 | * head: Head |
| 504 | 510 | * base: Base |
| 505 | 511 | * _links: Links |
| 506 | - * @return Consolidation\OutputFormatters\StructuredData\PropertyList |
|
| 512 | + * @return PropertyList |
|
| 507 | 513 | */ |
| 508 | 514 | public function prShow($projectWithOrg = '', $number = '', $options = ['as' => 'default', 'format' => 'table']) |
| 509 | 515 | { |
@@ -540,7 +546,7 @@ discard block |
||
| 540 | 546 | * updated_at: Updated |
| 541 | 547 | * @default-fields id,creator,state,description |
| 542 | 548 | * @default-string-field description |
| 543 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
| 549 | + * @return RowsOfFields |
|
| 544 | 550 | */ |
| 545 | 551 | public function prStatuses($projectWithOrg = '', $number = '', $options = ['as' => 'default', 'format' => 'yaml']) |
| 546 | 552 | { |
@@ -598,7 +604,7 @@ discard block |
||
| 598 | 604 | * _links: Links |
| 599 | 605 | * @default-fields number,user,title |
| 600 | 606 | * @default-string-field number |
| 601 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
| 607 | + * @return RowsOfFields |
|
| 602 | 608 | */ |
| 603 | 609 | public function prList($projectWithOrg = '', $options = ['state' => 'open', 'as' => 'default', 'format' => 'table']) |
| 604 | 610 | { |
@@ -649,6 +655,9 @@ discard block |
||
| 649 | 655 | ); |
| 650 | 656 | } |
| 651 | 657 | |
| 658 | + /** |
|
| 659 | + * @param string $field |
|
| 660 | + */ |
|
| 652 | 661 | protected function keyById($data, $field) |
| 653 | 662 | { |
| 654 | 663 | return |
@@ -2,9 +2,6 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace Hubph\Cli; |
| 4 | 4 | |
| 5 | -use Consolidation\AnnotatedCommand\CommandData; |
|
| 6 | -use Consolidation\Filter\FilterOutputData; |
|
| 7 | -use Consolidation\Filter\LogicalOpFactory; |
|
| 8 | 5 | use Consolidation\OutputFormatters\Options\FormatterOptions; |
| 9 | 6 | use Consolidation\OutputFormatters\StructuredData\RowsOfFields; |
| 10 | 7 | use Consolidation\OutputFormatters\StructuredData\PropertyList; |
@@ -15,7 +12,6 @@ discard block |
||
| 15 | 12 | use Consolidation\AnnotatedCommand\CommandError; |
| 16 | 13 | use Hubph\HubphAPI; |
| 17 | 14 | use Hubph\VersionIdentifiers; |
| 18 | -use Hubph\PullRequests; |
|
| 19 | 15 | use Hubph\Git\WorkingCopy; |
| 20 | 16 | |
| 21 | 17 | class HubphCommands extends \Robo\Tasks implements ConfigAwareInterface, LoggerAwareInterface |
@@ -3,9 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace Hubph\Git; |
| 5 | 5 | |
| 6 | -use Psr\Log\LoggerAwareInterface; |
|
| 7 | -use Psr\Log\LoggerAwareTrait; |
|
| 8 | -use Symfony\Component\Filesystem\Filesystem; |
|
| 9 | 6 | use Hubph\Util\ExecWithRedactionTrait; |
| 10 | 7 | |
| 11 | 8 | trait Git |
@@ -45,6 +45,9 @@ discard block |
||
| 45 | 45 | return !empty($this->remote); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | + /** |
|
| 49 | + * @return string |
|
| 50 | + */ |
|
| 48 | 51 | public function projectWithOrg() |
| 49 | 52 | { |
| 50 | 53 | return static::projectWithOrgFromUrl($this->remote); |
@@ -123,6 +126,9 @@ discard block |
||
| 123 | 126 | $this->git('push --delete {remote} {tag}', ['remote' => $this->remote, 'tag' => $tag]); |
| 124 | 127 | } |
| 125 | 128 | |
| 129 | + /** |
|
| 130 | + * @param string $tag |
|
| 131 | + */ |
|
| 126 | 132 | protected function satisfies($tag, $version_constraints) |
| 127 | 133 | { |
| 128 | 134 | // If we are using a regex rather than semver, then pass anything. |
@@ -184,6 +190,7 @@ discard block |
||
| 184 | 190 | /** |
| 185 | 191 | * Run a git function on the local working copy. Fail on error. |
| 186 | 192 | * |
| 193 | + * @param string $cmd |
|
| 187 | 194 | * @return string stdout |
| 188 | 195 | */ |
| 189 | 196 | public function git($cmd, $replacements = [], $redacted = []) |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Composer\Semver\Semver; |
| 6 | 6 | use Psr\Log\LoggerAwareInterface; |
| 7 | 7 | use Psr\Log\LoggerAwareTrait; |
| 8 | -use Symfony\Component\Filesystem\Filesystem; |
|
| 9 | 8 | use Hubph\Util\ExecWithRedactionTrait; |
| 10 | 9 | |
| 11 | 10 | class Remote implements LoggerAwareInterface |
@@ -35,6 +35,9 @@ discard block |
||
| 35 | 35 | $this->confirmCachedRepoHasCorrectRemote(); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | + /** |
|
| 39 | + * @param string $dir |
|
| 40 | + */ |
|
| 38 | 41 | public static function fromDir($dir, $remoteName = 'origin', $api = null) |
| 39 | 42 | { |
| 40 | 43 | $remote = Remote::fromDir($dir, $remoteName); |
@@ -218,6 +221,9 @@ discard block |
||
| 218 | 221 | return Remote::fromDir($this->dir, $remote_name); |
| 219 | 222 | } |
| 220 | 223 | |
| 224 | + /** |
|
| 225 | + * @return string |
|
| 226 | + */ |
|
| 221 | 227 | public function url($remote_name = '') |
| 222 | 228 | { |
| 223 | 229 | return $this->remote($remote_name)->url(); |
@@ -258,6 +264,8 @@ discard block |
||
| 258 | 264 | |
| 259 | 265 | /** |
| 260 | 266 | * Fetch from the specified remote. |
| 267 | + * @param string $remote |
|
| 268 | + * @param string $branch |
|
| 261 | 269 | */ |
| 262 | 270 | public function fetch($remote, $branch) |
| 263 | 271 | { |
@@ -3,6 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | trait ExecWithRedactionTrait |
| 5 | 5 | { |
| 6 | + /** |
|
| 7 | + * @param string $cmd |
|
| 8 | + */ |
|
| 6 | 9 | protected function execWithRedaction($cmd, $replacements = [], $redacted = []) |
| 7 | 10 | { |
| 8 | 11 | $redactedReplacements = $this->redactedReplacements($replacements, $redacted); |