| @@ 101-110 (lines=10) @@ | ||
| 98 | return 'hey, I need a username!'; |
|
| 99 | } |
|
| 100 | $results = $this->queryGerrit('is:open owner:"' . $username . '" project:' . $project); |
|
| 101 | if (count($results) > 0) { |
|
| 102 | $listOfItems = ['*Here are the results for ' . $username . '*:']; |
|
| 103 | if (is_array($results)) { |
|
| 104 | foreach ($results as $item) { |
|
| 105 | $listOfItems[] = $this->buildReviewLine($item); |
|
| 106 | } |
|
| 107 | } |
|
| 108 | ||
| 109 | return implode("\n", $listOfItems); |
|
| 110 | } |
|
| 111 | return $username . ' has no open reviews or username is unknown'; |
|
| 112 | } |
|
| 113 | ||
| @@ 178-186 (lines=9) @@ | ||
| 175 | } |
|
| 176 | ||
| 177 | $results = $this->queryGerrit('limit:50 ' . $query); |
|
| 178 | if (count($results) > 0) { |
|
| 179 | $listOfItems = ["*Here are the results for {$query}*:"]; |
|
| 180 | if (is_array($results)) { |
|
| 181 | foreach ($results as $item) { |
|
| 182 | $listOfItems[] = $this->buildReviewLine($item); |
|
| 183 | } |
|
| 184 | } |
|
| 185 | return implode(chr(10), $listOfItems); |
|
| 186 | } |
|
| 187 | ||
| 188 | return "{$query} not found, sorry!"; |
|
| 189 | } |
|