Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -165,8 +165,8 @@ |
166 | 166 | * confusing (e.g. in e-mails, page titles etc.). If only one repository is |
167 | 167 | * defined then this returns the same as getIdString() as there is no ambiguity. |
168 | 168 | * |
169 | | - * @param null $id |
170 | | - * @return |
| 169 | + * @param $id int |
| 170 | + * @return string |
171 | 171 | */ |
172 | 172 | public function getIdStringUnique( $id = null ) { |
173 | 173 | if ( $id === null ) { |
— | — | @@ -743,7 +743,7 @@ |
744 | 744 | return $comments; |
745 | 745 | } |
746 | 746 | |
747 | | - /* |
| 747 | + /** |
748 | 748 | * @return int |
749 | 749 | */ |
750 | 750 | public function getCommentCount() { |
— | — | @@ -813,8 +813,10 @@ |
814 | 814 | } |
815 | 815 | |
816 | 816 | /** |
817 | | - * "Review" being revision commenters, and people who set/removed tags and changed the status |
818 | | - */ |
| 817 | + * "Review" being revision commenters, and people who set/removed tags and changed the status |
| 818 | + * |
| 819 | + * @return array |
| 820 | + */ |
819 | 821 | public function getReviewContributingUsers() { |
820 | 822 | return array_merge( $this->getCommentingUsers(), $this->getPropChangeUsers() ); |
821 | 823 | } |
— | — | @@ -936,7 +938,7 @@ |
937 | 939 | |
938 | 940 | /** |
939 | 941 | * Get all sign-offs for this revision |
940 | | - * @param $from DB_SLAVE or DB_MASTER |
| 942 | + * @param $from int DB_SLAVE or DB_MASTER |
941 | 943 | * @return array of CodeSignoff objects |
942 | 944 | */ |
943 | 945 | public function getSignoffs( $from = DB_SLAVE ) { |
— | — | @@ -1018,10 +1020,9 @@ |
1019 | 1021 | } |
1020 | 1022 | |
1021 | 1023 | /** |
1022 | | - * @param $addTags |
1023 | | - * @param $removeTags |
1024 | | - * @param null $user |
1025 | | - * @return void |
| 1024 | + * @param $addTags array |
| 1025 | + * @param $removeTags array |
| 1026 | + * @param $user User |
1026 | 1027 | */ |
1027 | 1028 | public function changeTags( $addTags, $removeTags, $user = null ) { |
1028 | 1029 | // Get the current tags and see what changes |
— | — | @@ -1258,9 +1259,8 @@ |
1259 | 1260 | } |
1260 | 1261 | |
1261 | 1262 | /** |
1262 | | - * @param $status |
1263 | | - * @param $oldStatus |
1264 | | - * @return void |
| 1263 | + * @param $status string |
| 1264 | + * @param $oldStatus string |
1265 | 1265 | */ |
1266 | 1266 | protected function sendStatusToUDP( $status, $oldStatus ) { |
1267 | 1267 | global $wgCodeReviewUDPAddress, $wgCodeReviewUDPPort, $wgCodeReviewUDPPrefix, $wgUser; |
Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | * @param $id Int Database id for the repo |
35 | 35 | * @param $name String User-defined name for the repository |
36 | 36 | * @param $path String Path to SVN |
37 | | - * @param $viewVc String Base path to ViewVC URLs |
| 37 | + * @param $viewvc String Base path to ViewVC URLs |
38 | 38 | * @param $bugzilla String Base path to Bugzilla |
39 | 39 | */ |
40 | 40 | public function __construct( $id, $name, $path, $viewvc, $bugzilla ) { |
— | — | @@ -44,6 +44,10 @@ |
45 | 45 | $this->bugzilla = $bugzilla; |
46 | 46 | } |
47 | 47 | |
| 48 | + /** |
| 49 | + * @param $name string |
| 50 | + * @return CodeRepository|null |
| 51 | + */ |
48 | 52 | public static function newFromName( $name ) { |
49 | 53 | $dbw = wfGetDB( DB_MASTER ); |
50 | 54 | $row = $dbw->selectRow( |
— | — | @@ -64,6 +68,10 @@ |
65 | 69 | } |
66 | 70 | } |
67 | 71 | |
| 72 | + /** |
| 73 | + * @param $id int |
| 74 | + * @return CodeRepository|null |
| 75 | + */ |
68 | 76 | public static function newFromId( $id ) { |
69 | 77 | $dbw = wfGetDB( DB_MASTER ); |
70 | 78 | $row = $dbw->selectRow( |
— | — | @@ -84,6 +92,10 @@ |
85 | 93 | } |
86 | 94 | } |
87 | 95 | |
| 96 | + /** |
| 97 | + * @param $row |
| 98 | + * @return CodeRepository |
| 99 | + */ |
88 | 100 | static function newFromRow( $row ) { |
89 | 101 | return new CodeRepository( |
90 | 102 | intval( $row->repo_id ), |
— | — | @@ -94,6 +106,9 @@ |
95 | 107 | ); |
96 | 108 | } |
97 | 109 | |
| 110 | + /** |
| 111 | + * @return array |
| 112 | + */ |
98 | 113 | static function getRepoList() { |
99 | 114 | $dbr = wfGetDB( DB_SLAVE ); |
100 | 115 | $options = array( 'ORDER BY' => 'repo_name' ); |
— | — | @@ -105,28 +120,46 @@ |
106 | 121 | return $repos; |
107 | 122 | } |
108 | 123 | |
| 124 | + /** |
| 125 | + * @return int |
| 126 | + */ |
109 | 127 | public function getId() { |
110 | 128 | return intval( $this->id ); |
111 | 129 | } |
112 | 130 | |
| 131 | + /** |
| 132 | + * @return String |
| 133 | + */ |
113 | 134 | public function getName() { |
114 | 135 | return $this->name; |
115 | 136 | } |
116 | 137 | |
| 138 | + /** |
| 139 | + * @return String |
| 140 | + */ |
117 | 141 | public function getPath() { |
118 | 142 | return $this->path; |
119 | 143 | } |
120 | 144 | |
| 145 | + /** |
| 146 | + * @return String |
| 147 | + */ |
121 | 148 | public function getViewVcBase() { |
122 | 149 | return $this->viewVc; |
123 | 150 | } |
124 | 151 | |
| 152 | + /** |
| 153 | + * @return String |
| 154 | + */ |
125 | 155 | public function getBugzillaBase() { |
126 | 156 | return $this->bugzilla; |
127 | 157 | } |
128 | 158 | |
129 | 159 | /** |
130 | | - * Return a bug URL or false. |
| 160 | + * Return a bug URL or false |
| 161 | + * |
| 162 | + * @param $bugId int|string |
| 163 | + * @return string|false. |
131 | 164 | */ |
132 | 165 | public function getBugPath( $bugId ) { |
133 | 166 | if ( $this->bugzilla ) { |
— | — | @@ -136,6 +169,9 @@ |
137 | 170 | return false; |
138 | 171 | } |
139 | 172 | |
| 173 | + /** |
| 174 | + * @return int |
| 175 | + */ |
140 | 176 | public function getLastStoredRev() { |
141 | 177 | $dbr = wfGetDB( DB_SLAVE ); |
142 | 178 | $row = $dbr->selectField( |
— | — | @@ -147,6 +183,9 @@ |
148 | 184 | return intval( $row ); |
149 | 185 | } |
150 | 186 | |
| 187 | + /** |
| 188 | + * @return array |
| 189 | + */ |
151 | 190 | public function getAuthorList() { |
152 | 191 | global $wgMemc; |
153 | 192 | $key = wfMemcKey( 'codereview', 'authors', $this->getId() ); |
— | — | @@ -173,6 +212,9 @@ |
174 | 213 | return $authors; |
175 | 214 | } |
176 | 215 | |
| 216 | + /** |
| 217 | + * @return int |
| 218 | + */ |
177 | 219 | public function getAuthorCount() { |
178 | 220 | return count( $this->getAuthorList() ); |
179 | 221 | } |
— | — | @@ -208,6 +250,8 @@ |
209 | 251 | |
210 | 252 | /** |
211 | 253 | * Load a particular revision out of the DB |
| 254 | + * @param $id int|string |
| 255 | + * @return CodeRevision |
212 | 256 | */ |
213 | 257 | public function getRevision( $id ) { |
214 | 258 | if ( !$this->isValidRev( $id ) ) { |
— | — | @@ -231,6 +275,9 @@ |
232 | 276 | /** |
233 | 277 | * Returns the supplied revision ID as a string ready for output, including the |
234 | 278 | * appropriate (localisable) prefix (e.g. "r123" instead of 123). |
| 279 | + * |
| 280 | + * @param $id string |
| 281 | + * @return string |
235 | 282 | */ |
236 | 283 | public function getRevIdString( $id ) { |
237 | 284 | return wfMsg( 'code-rev-id', $id ); |
— | — | @@ -244,6 +291,9 @@ |
245 | 292 | * confusing (e.g. in e-mails, page titles etc.). If only one repository is |
246 | 293 | * defined then this returns the same as getRevIdString() as there |
247 | 294 | * is no ambiguity. |
| 295 | + * |
| 296 | + * @param $id string |
| 297 | + * @return string |
248 | 298 | */ |
249 | 299 | public function getRevIdStringUnique( $id ) { |
250 | 300 | $id = wfMsg( 'code-rev-id', $id ); |
— | — | @@ -258,8 +308,8 @@ |
259 | 309 | } |
260 | 310 | |
261 | 311 | /** |
262 | | - * @param int $rev Revision ID |
263 | | - * @param $useCache 'skipcache' to avoid caching |
| 312 | + * @param $rev int Revision ID |
| 313 | + * @param $useCache string 'skipcache' to avoid caching |
264 | 314 | * 'cached' to *only* fetch if cached |
265 | 315 | * @return string|int The diff text on success, a DIFFRESULT_* constant on failure. |
266 | 316 | */ |
— | — | @@ -471,6 +521,9 @@ |
472 | 522 | /** |
473 | 523 | * returns a User object if $author has a wikiuser associated, |
474 | 524 | * or false |
| 525 | + * |
| 526 | + * @param $author string |
| 527 | + * |
475 | 528 | * @return User|bool |
476 | 529 | */ |
477 | 530 | public function authorWikiUser( $author ) { |
— | — | @@ -503,6 +556,10 @@ |
504 | 557 | /** |
505 | 558 | * returns an author name if $name wikiuser has an author associated, |
506 | 559 | * or false |
| 560 | + * |
| 561 | + * @param $name string |
| 562 | + * |
| 563 | + * @return string|false |
507 | 564 | */ |
508 | 565 | public function wikiUserAuthor( $name ) { |
509 | 566 | if ( isset( self::$authorLinks[$name] ) ) |
Index: trunk/extensions/CodeReview/backend/CodeComment.php |
— | — | @@ -3,14 +3,32 @@ |
4 | 4 | class CodeComment { |
5 | 5 | public $id, $text, $user, $userText, $timestamp, $review, $sortkey, $attrib, $removed, $added; |
6 | 6 | |
| 7 | + /** |
| 8 | + * @var CodeRevision |
| 9 | + */ |
| 10 | + public $rev; |
| 11 | + |
| 12 | + /** |
| 13 | + * @param $rev CodeRevision |
| 14 | + */ |
7 | 15 | function __construct( $rev ) { |
8 | 16 | $this->rev = $rev; |
9 | 17 | } |
10 | 18 | |
| 19 | + /** |
| 20 | + * @param $rev Revision |
| 21 | + * @param $row |
| 22 | + * @return CodeComment |
| 23 | + */ |
11 | 24 | static function newFromRow( $rev, $row ) { |
12 | 25 | return self::newFromData( $rev, get_object_vars( $row ) ); |
13 | 26 | } |
14 | 27 | |
| 28 | + /** |
| 29 | + * @param $rev Revision |
| 30 | + * @param $data array |
| 31 | + * @return CodeComment |
| 32 | + */ |
15 | 33 | static function newFromData( $rev, $data ) { |
16 | 34 | $comment = new CodeComment( $rev ); |
17 | 35 | $comment->id = intval( $data['cc_id'] ); |
— | — | @@ -23,6 +41,9 @@ |
24 | 42 | return $comment; |
25 | 43 | } |
26 | 44 | |
| 45 | + /** |
| 46 | + * @return int |
| 47 | + */ |
27 | 48 | function threadDepth() { |
28 | 49 | $timestamps = explode( ",", $this->sortkey ); |
29 | 50 | return count( $timestamps ); |
Index: trunk/extensions/CodeReview/backend/CodePropChange.php |
— | — | @@ -9,14 +9,27 @@ |
10 | 10 | */ |
11 | 11 | public $rev; |
12 | 12 | |
| 13 | + /** |
| 14 | + * @param $rev CodeRevision |
| 15 | + */ |
13 | 16 | function __construct( $rev ) { |
14 | 17 | $this->rev = $rev; |
15 | 18 | } |
16 | 19 | |
| 20 | + /** |
| 21 | + * @param $rev CodeRevision |
| 22 | + * @param $row |
| 23 | + * @return CodePropChange |
| 24 | + */ |
17 | 25 | static function newFromRow( $rev, $row ) { |
18 | 26 | return self::newFromData( $rev, get_object_vars( $row ) ); |
19 | 27 | } |
20 | 28 | |
| 29 | + /** |
| 30 | + * @param $rev CodeRevision |
| 31 | + * @param $data |
| 32 | + * @return CodePropChange |
| 33 | + */ |
21 | 34 | static function newFromData( $rev, $data ) { |
22 | 35 | $change = new CodePropChange( $rev ); |
23 | 36 | $change->attrib = $data['cpc_attrib']; |
Index: trunk/extensions/CodeReview/backend/CodeCommentLinker.php |
— | — | @@ -12,12 +12,19 @@ |
13 | 13 | */ |
14 | 14 | protected $mRepo; |
15 | 15 | |
| 16 | + /** |
| 17 | + * @param $repo CodeRepository |
| 18 | + */ |
16 | 19 | function __construct( $repo ) { |
17 | 20 | global $wgUser; |
18 | 21 | $this->skin = $wgUser->getSkin(); |
19 | 22 | $this->mRepo = $repo; |
20 | 23 | } |
21 | 24 | |
| 25 | + /** |
| 26 | + * @param $text string |
| 27 | + * @return string |
| 28 | + */ |
22 | 29 | function link( $text ) { |
23 | 30 | # Catch links like http://www.mediawiki.org/wiki/Special:Code/MediaWiki/44245#c829 |
24 | 31 | # Ended by space or brackets (like those pesky <br /> tags) |
— | — | @@ -30,12 +37,20 @@ |
31 | 38 | return $text; |
32 | 39 | } |
33 | 40 | |
| 41 | + /** |
| 42 | + * @param $arr array |
| 43 | + * @return string |
| 44 | + */ |
34 | 45 | function generalLink( $arr ) { |
35 | 46 | $url = $arr[2] . $arr[3]; |
36 | 47 | // Re-add the surrounding space/punctuation |
37 | 48 | return $arr[1] . $this->makeExternalLink( $url, $url ); |
38 | 49 | } |
39 | 50 | |
| 51 | + /** |
| 52 | + * @param $arr array |
| 53 | + * @return string |
| 54 | + */ |
40 | 55 | function messageBugLink( $arr ) { |
41 | 56 | $text = $arr[0]; |
42 | 57 | $bugNo = intval( $arr[1] ); |
— | — | @@ -47,6 +62,9 @@ |
48 | 63 | } |
49 | 64 | } |
50 | 65 | |
| 66 | + /** |
| 67 | + * @param $matches array |
| 68 | + */ |
51 | 69 | function messageRevLink( $matches ) { |
52 | 70 | $text = $matches[0]; |
53 | 71 | $rev = intval( $matches[1] ); |
— | — | @@ -57,29 +75,50 @@ |
58 | 76 | return $this->makeInternalLink( $title, $text ); |
59 | 77 | } |
60 | 78 | |
| 79 | + /** |
| 80 | + * @param $url string |
| 81 | + * @param $text string |
| 82 | + * @return string |
| 83 | + */ |
61 | 84 | abstract function makeExternalLink( $url, $text ); |
62 | 85 | |
63 | 86 | abstract function makeInternalLink( $title, $text ); |
64 | 87 | } |
65 | 88 | |
66 | 89 | class CodeCommentLinkerHtml extends CodeCommentLinker { |
| 90 | + |
| 91 | + /** |
| 92 | + * @param $url string |
| 93 | + * @param $text string |
| 94 | + * @return string |
| 95 | + */ |
67 | 96 | function makeExternalLink( $url, $text ) { |
68 | 97 | return $this->skin->makeExternalLink( $url, $text ); |
69 | 98 | } |
70 | 99 | |
| 100 | + /** |
| 101 | + * @param $title Title |
| 102 | + * @param $text string |
| 103 | + * @return string |
| 104 | + */ |
71 | 105 | function makeInternalLink( $title, $text ) { |
72 | 106 | return $this->skin->link( $title, $text ); |
73 | 107 | } |
74 | 108 | } |
75 | 109 | |
76 | 110 | class CodeCommentLinkerWiki extends CodeCommentLinker { |
| 111 | + /** |
| 112 | + * @param $url string |
| 113 | + * @param $text string |
| 114 | + * @return string |
| 115 | + */ |
77 | 116 | function makeExternalLink( $url, $text ) { |
78 | 117 | return "[$url $text]"; |
79 | 118 | } |
80 | 119 | |
81 | 120 | /** |
82 | | - * @param Title $title |
83 | | - * @param $text |
| 121 | + * @param $title Title |
| 122 | + * @param $text string |
84 | 123 | * @return string |
85 | 124 | */ |
86 | 125 | function makeInternalLink( $title, $text ) { |
Index: trunk/extensions/CodeReview/backend/RepoStats.php |
— | — | @@ -1,6 +1,10 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class RepoStats { |
| 5 | + |
| 6 | + /** |
| 7 | + * @var CodeRepository |
| 8 | + */ |
5 | 9 | private $repo; |
6 | 10 | |
7 | 11 | public $time; |
— | — | @@ -11,6 +15,10 @@ |
12 | 16 | $states, |
13 | 17 | $fixmes; |
14 | 18 | |
| 19 | + /** |
| 20 | + * @param CodeRepository $repo |
| 21 | + * @return RepoStats |
| 22 | + */ |
15 | 23 | public static function newFromRepo( CodeRepository $repo ) { |
16 | 24 | global $wgMemc, $wgCodeReviewRepoStatsCacheTime; |
17 | 25 | |
— | — | @@ -28,6 +36,9 @@ |
29 | 37 | return $stats; |
30 | 38 | } |
31 | 39 | |
| 40 | + /** |
| 41 | + * @param $repo CodeRepository |
| 42 | + */ |
32 | 43 | public function __construct( CodeRepository $repo ) { |
33 | 44 | $this->repo = $repo; |
34 | 45 | $this->time = wfTimestamp( TS_MW ); |
Index: trunk/extensions/CodeReview/backend/CodeSignoff.php |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | /** |
100 | 100 | * Create a CodeSignoff object from a revision and a database row in array format |
101 | 101 | * @param $rev CodeRevision object the signoff belongs to |
102 | | - * @param $row array Database row with cs_* fields from code_signoffs |
| 102 | + * @param $data array Database row with cs_* fields from code_signoffs |
103 | 103 | * @return CodeSignoff |
104 | 104 | */ |
105 | 105 | public static function newFromData( $rev, $data ) { |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -9,7 +9,6 @@ |
10 | 10 | * @param string|CodeRepository $repo |
11 | 11 | * @param string|CodeRevision $rev |
12 | 12 | * @param null $replyTarget |
13 | | - * |
14 | 13 | */ |
15 | 14 | function __construct( $repo, $rev, $replyTarget = null ) { |
16 | 15 | parent::__construct( $repo ); |
— | — | @@ -57,6 +56,10 @@ |
58 | 57 | $wgRequest->getIntArray( 'wpReferences', array() ) : array(); |
59 | 58 | } |
60 | 59 | |
| 60 | + /** |
| 61 | + * @param $item string |
| 62 | + * @return int |
| 63 | + */ |
61 | 64 | private function ltrimIntval( $item ) { |
62 | 65 | $item = ltrim( $item, 'r' ); |
63 | 66 | return intval( $item ); |
— | — | @@ -240,6 +243,9 @@ |
241 | 244 | return false; |
242 | 245 | } |
243 | 246 | |
| 247 | + /** |
| 248 | + * @return bool |
| 249 | + */ |
244 | 250 | protected function canPostComments() { |
245 | 251 | global $wgUser; |
246 | 252 | return $wgUser->isAllowed( 'codereview-post-comment' ) && !$wgUser->isBlocked(); |
— | — | @@ -332,6 +338,10 @@ |
333 | 339 | return $tags; |
334 | 340 | } |
335 | 341 | |
| 342 | + /** |
| 343 | + * @param $tags array |
| 344 | + * @return string |
| 345 | + */ |
336 | 346 | static function listTags( $tags ) { |
337 | 347 | if ( empty( $tags ) ) { |
338 | 348 | return ""; |
— | — | @@ -339,6 +349,9 @@ |
340 | 350 | return implode( ",", $tags ); |
341 | 351 | } |
342 | 352 | |
| 353 | + /** |
| 354 | + * @return string |
| 355 | + */ |
343 | 356 | protected function statusForm() { |
344 | 357 | global $wgUser; |
345 | 358 | if ( $wgUser->isAllowed( 'codereview-set-status' ) ) { |
— | — | @@ -366,7 +379,12 @@ |
367 | 380 | return $out; |
368 | 381 | } |
369 | 382 | |
370 | | - /** Parameters are the tags to be added/removed sent with the request */ |
| 383 | + /** |
| 384 | + * Parameters are the tags to be added/removed sent with the request |
| 385 | + * @param $addTags array |
| 386 | + * @param $removeTags array |
| 387 | + * @return string |
| 388 | + */ |
371 | 389 | static function addTagForm( $addTags, $removeTags ) { |
372 | 390 | return '<div><table><tr><td>' . |
373 | 391 | Xml::inputLabel( wfMsg( 'code-rev-tag-add' ), 'wpTag', 'wpTag', 20, |
— | — | @@ -375,12 +393,19 @@ |
376 | 394 | self::listTags( $removeTags ) ) . '</td></tr></table></div>'; |
377 | 395 | } |
378 | 396 | |
| 397 | + /** |
| 398 | + * @param $tag string |
| 399 | + * @return string |
| 400 | + */ |
379 | 401 | protected function formatTag( $tag ) { |
380 | 402 | $repo = $this->mRepo->getName(); |
381 | 403 | $special = SpecialPage::getTitleFor( 'Code', "$repo/tag/$tag" ); |
382 | 404 | return $this->skin->link( $special, htmlspecialchars( $tag ) ); |
383 | 405 | } |
384 | 406 | |
| 407 | + /** |
| 408 | + * @return string |
| 409 | + */ |
385 | 410 | protected function formatDiff() { |
386 | 411 | global $wgEnableAPI, $wgCodeReviewMaxDiffSize; |
387 | 412 | |
— | — | @@ -413,6 +438,9 @@ |
414 | 439 | } |
415 | 440 | } |
416 | 441 | |
| 442 | + /** |
| 443 | + * @return string |
| 444 | + */ |
417 | 445 | protected function formatImgDiff() { |
418 | 446 | global $wgCodeReviewImgRegex; |
419 | 447 | // Get image diffs |
— | — | @@ -445,6 +473,12 @@ |
446 | 474 | return $html; |
447 | 475 | } |
448 | 476 | |
| 477 | + /** |
| 478 | + * @param $path |
| 479 | + * @param $rev |
| 480 | + * @param $message |
| 481 | + * @return string |
| 482 | + */ |
449 | 483 | protected function formatImgCell( $path, $rev, $message ) { |
450 | 484 | $viewvc = $this->mRepo->getViewVcBase(); |
451 | 485 | $safePath = wfUrlEncode( $path ); |
— | — | @@ -464,6 +498,9 @@ |
465 | 499 | 'border' => '0' ) ) ) ); |
466 | 500 | } |
467 | 501 | |
| 502 | + /** |
| 503 | + * @return bool|string |
| 504 | + */ |
468 | 505 | protected function stubDiffLoader() { |
469 | 506 | global $wgOut; |
470 | 507 | $encRepo = Xml::encodeJsVar( $this->mRepo->getName() ); |
— | — | @@ -480,6 +517,7 @@ |
481 | 518 | |
482 | 519 | /** |
483 | 520 | * Format the sign-offs table |
| 521 | + * @param $signOffs array |
484 | 522 | * @param $showButtons bool Whether the buttons to strike and submit sign-offs should be shown |
485 | 523 | * @return string HTML |
486 | 524 | */ |
— | — | @@ -500,6 +538,9 @@ |
501 | 539 | return "<table border='1' class='TablePager'><tr>$header</tr>$signoffs$buttonrow</table>"; |
502 | 540 | } |
503 | 541 | |
| 542 | + /** |
| 543 | + * @return bool|string |
| 544 | + */ |
504 | 545 | protected function formatComments() { |
505 | 546 | $comments = implode( "\n", |
506 | 547 | array_map( array( $this, 'formatCommentInline' ), $this->mRev->getComments() ) |
— | — | @@ -513,6 +554,9 @@ |
514 | 555 | return "<div class='mw-codereview-comments'>$comments</div>"; |
515 | 556 | } |
516 | 557 | |
| 558 | + /** |
| 559 | + * @return bool|string |
| 560 | + */ |
517 | 561 | protected function formatPropChanges() { |
518 | 562 | $changes = implode( "\n", |
519 | 563 | array_map( array( $this, 'formatChangeInline' ), $this->mRev->getPropChanges() ) |
— | — | @@ -523,6 +567,11 @@ |
524 | 568 | return "<ul class='mw-codereview-changes'>$changes</ul>"; |
525 | 569 | } |
526 | 570 | |
| 571 | + /** |
| 572 | + * @param $references array |
| 573 | + * @param $showButtons bool |
| 574 | + * @return string |
| 575 | + */ |
527 | 576 | protected function formatReferences( $references, $showButtons ) { |
528 | 577 | $this->showButtonsFormatReference = $showButtons; |
529 | 578 | $refs = implode( "\n", |
— | — | @@ -583,7 +632,7 @@ |
584 | 633 | } |
585 | 634 | |
586 | 635 | /** |
587 | | - * @param $change CodePropChange |
| 636 | + * @param $change CodePropChange |
588 | 637 | * @return string |
589 | 638 | */ |
590 | 639 | protected function formatChangeInline( $change ) { |
— | — | @@ -623,6 +672,10 @@ |
624 | 673 | return "<li>$line</li>"; |
625 | 674 | } |
626 | 675 | |
| 676 | + /** |
| 677 | + * @param $row |
| 678 | + * @return string |
| 679 | + */ |
627 | 680 | protected function formatReferenceInline( $row ) { |
628 | 681 | global $wgLang; |
629 | 682 | $rev = intval( $row->cr_id ); |
— | — | @@ -644,6 +697,10 @@ |
645 | 698 | return $ret; |
646 | 699 | } |
647 | 700 | |
| 701 | + /** |
| 702 | + * @param $commentId int |
| 703 | + * @return Title |
| 704 | + */ |
648 | 705 | protected function commentLink( $commentId ) { |
649 | 706 | $repo = $this->mRepo->getName(); |
650 | 707 | $rev = $this->mRev->getId(); |
— | — | @@ -652,6 +709,9 @@ |
653 | 710 | return $title; |
654 | 711 | } |
655 | 712 | |
| 713 | + /** |
| 714 | + * @return Title |
| 715 | + */ |
656 | 716 | protected function revLink() { |
657 | 717 | $repo = $this->mRepo->getName(); |
658 | 718 | $rev = $this->mRev->getId(); |
— | — | @@ -659,6 +719,11 @@ |
660 | 720 | return $title; |
661 | 721 | } |
662 | 722 | |
| 723 | + /** |
| 724 | + * @param $text string |
| 725 | + * @param $review int |
| 726 | + * @return string |
| 727 | + */ |
663 | 728 | protected function previewComment( $text, $review = 0 ) { |
664 | 729 | $comment = $this->mRev->previewComment( $text, $review ); |
665 | 730 | return $this->formatComment( $comment ); |
— | — | @@ -716,6 +781,10 @@ |
717 | 782 | return "margin-left: ${margin}px"; |
718 | 783 | } |
719 | 784 | |
| 785 | + /** |
| 786 | + * @param $id int |
| 787 | + * @return string |
| 788 | + */ |
720 | 789 | protected function commentReplyLink( $id ) { |
721 | 790 | if ( !$this->canPostComments() ) { |
722 | 791 | return ''; |
— | — | @@ -760,6 +829,8 @@ |
761 | 830 | /** |
762 | 831 | * Render the bottom row of the sign-offs table containing the buttons to |
763 | 832 | * strike and submit sign-offs |
| 833 | + * |
| 834 | + * @param $signOffs array |
764 | 835 | * @return string HTML |
765 | 836 | */ |
766 | 837 | protected function signoffButtons( $signOffs ) { |
— | — | @@ -815,6 +886,9 @@ |
816 | 887 | "<div class='mw-codereview-associateform'>$associateText $textbox $associateButton</div></td></tr>"; |
817 | 888 | } |
818 | 889 | |
| 890 | + /** |
| 891 | + * @return string |
| 892 | + */ |
819 | 893 | protected function addActionButtons() { |
820 | 894 | return '<div>' . |
821 | 895 | Xml::submitButton( wfMsg( 'code-rev-submit' ), |