@@ -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"; |
@@ -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 | |
20 | 16 | class HubphCommands extends \Robo\Tasks implements ConfigAwareInterface, LoggerAwareInterface |
21 | 17 | { |
@@ -193,6 +193,9 @@ discard block |
||
193 | 193 | return $this->getProjectWithOrfFromUrl($remote); |
194 | 194 | } |
195 | 195 | |
196 | + /** |
|
197 | + * @param string $remote |
|
198 | + */ |
|
196 | 199 | protected function getProjectWithOrfFromUrl($remote) |
197 | 200 | { |
198 | 201 | $remote = preg_replace('#^git@[^:]*:#', '', $remote); |
@@ -250,7 +253,7 @@ discard block |
||
250 | 253 | * _links: Links |
251 | 254 | * @default-fields number,user,title |
252 | 255 | * @default-string-field number |
253 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
256 | + * @return RowsOfFields |
|
254 | 257 | */ |
255 | 258 | public function prFind($projectWithOrg = '', $options = ['as' => 'default', 'format' => 'yaml', 'q' => '']) |
256 | 259 | { |
@@ -310,7 +313,7 @@ discard block |
||
310 | 313 | * @default-fields full_name,language,default_branch |
311 | 314 | * @default-string-field full_name |
312 | 315 | * |
313 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
316 | + * @return RowsOfFields |
|
314 | 317 | */ |
315 | 318 | public function orgRepos($org, $options = ['as' => 'default', 'format' => 'table']) |
316 | 319 | { |
@@ -361,7 +364,7 @@ discard block |
||
361 | 364 | * license: License |
362 | 365 | * permissions: Permissions |
363 | 366 | * |
364 | - * @return Consolidation\OutputFormatters\StructuredData\PropertyList |
|
367 | + * @return PropertyList |
|
365 | 368 | */ |
366 | 369 | public function repoInfo($projectWithOrg, $options = ['as' => 'default', 'format' => 'table']) |
367 | 370 | { |
@@ -415,7 +418,7 @@ discard block |
||
415 | 418 | * head: Head |
416 | 419 | * base: Base |
417 | 420 | * _links: Links |
418 | - * @return Consolidation\OutputFormatters\StructuredData\PropertyList |
|
421 | + * @return PropertyList |
|
419 | 422 | */ |
420 | 423 | public function prShow($projectWithOrg = '', $number = '', $options = ['as' => 'default', 'format' => 'table']) |
421 | 424 | { |
@@ -452,7 +455,7 @@ discard block |
||
452 | 455 | * updated_at: Updated |
453 | 456 | * @default-fields id,creator,state,description |
454 | 457 | * @default-string-field description |
455 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
458 | + * @return RowsOfFields |
|
456 | 459 | */ |
457 | 460 | public function prStatuses($projectWithOrg = '', $number = '', $options = ['as' => 'default', 'format' => 'yaml']) |
458 | 461 | { |
@@ -510,7 +513,7 @@ discard block |
||
510 | 513 | * _links: Links |
511 | 514 | * @default-fields number,user,title |
512 | 515 | * @default-string-field number |
513 | - * @return Consolidation\OutputFormatters\StructuredData\RowsOfFields |
|
516 | + * @return RowsOfFields |
|
514 | 517 | */ |
515 | 518 | public function prList($projectWithOrg = '', $options = ['state' => 'open', 'as' => 'default', 'format' => 'table']) |
516 | 519 | { |
@@ -561,6 +564,9 @@ discard block |
||
561 | 564 | ); |
562 | 565 | } |
563 | 566 | |
567 | + /** |
|
568 | + * @param string $field |
|
569 | + */ |
|
564 | 570 | protected function keyById($data, $field) |
565 | 571 | { |
566 | 572 | return |