Index: trunk/extensions/CodeReview/tests/CodeReviewTest.php |
— | — | @@ -15,12 +15,12 @@ |
16 | 16 | public function testCommentWikiFormatting() { |
17 | 17 | $repo = $this->createRepo(); |
18 | 18 | $formatter = new CodeCommentLinkerWiki( $repo ); |
19 | | - |
| 19 | + |
20 | 20 | $this->assertEquals( '[http://foo http://foo]', $formatter->link( 'http://foo' ) ); |
21 | 21 | $this->assertEquals( '[http://example.com/bugzilla/123 bug 123]', $formatter->link( 'bug 123' ) ); |
22 | 22 | $this->assertEquals( '[[Special:Code/Test/456|r456]]', $formatter->link( 'r456' ) ); |
23 | 23 | // fails, bug 23203 and so on |
24 | | - //$this->assertEquals( '[http://example.org foo http://example.org foo]', $formatter->link( '[http://example.org foo http://example.org foo]' ) ); |
25 | | - //$this->assertEquals( '[http://foo.bar r123]', $formatter->link( '[http://foo.bar r123]' ) ); |
| 24 | + // $this->assertEquals( '[http://example.org foo http://example.org foo]', $formatter->link( '[http://example.org foo http://example.org foo]' ) ); |
| 25 | + // $this->assertEquals( '[http://foo.bar r123]', $formatter->link( '[http://foo.bar r123]' ) ); |
26 | 26 | } |
27 | 27 | } |
\ No newline at end of file |
Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -31,8 +31,11 @@ |
32 | 32 | |
33 | 33 | $tmp = array(); |
34 | 34 | foreach ( $common as $k => $v ) { |
35 | | - if ( $v == $compare[$k] ) $tmp[] = $v; |
36 | | - else break; |
| 35 | + if ( $v == $compare[$k] ) { |
| 36 | + $tmp[] = $v; |
| 37 | + } else { |
| 38 | + break; |
| 39 | + } |
37 | 40 | } |
38 | 41 | $common = $tmp; |
39 | 42 | } |
— | — | @@ -45,8 +48,8 @@ |
46 | 49 | |
47 | 50 | // Check for ignored paths |
48 | 51 | global $wgCodeReviewDeferredPaths; |
49 | | - if( isset( $wgCodeReviewDeferredPaths[ $repo->getName() ] ) ) { |
50 | | - foreach( $wgCodeReviewDeferredPaths[ $repo->getName() ] as $defer ) { |
| 52 | + if ( isset( $wgCodeReviewDeferredPaths[ $repo->getName() ] ) ) { |
| 53 | + foreach ( $wgCodeReviewDeferredPaths[ $repo->getName() ] as $defer ) { |
51 | 54 | if ( preg_match( $defer, $rev->mCommonPath ) ) { |
52 | 55 | $rev->mStatus = 'deferred'; |
53 | 56 | break; |
— | — | @@ -88,10 +91,10 @@ |
89 | 92 | } |
90 | 93 | |
91 | 94 | /** |
92 | | - * Like getIdString(), but if more than one repository is defined |
| 95 | + * Like getIdString(), but if more than one repository is defined |
93 | 96 | * on the wiki then it includes the repo name as a prefix to the revision ID |
94 | 97 | * (separated with a period). |
95 | | - * This ensures you get a unique reference, as the revision ID alone can be |
| 98 | + * This ensures you get a unique reference, as the revision ID alone can be |
96 | 99 | * confusing (e.g. in e-mails, page titles etc.). If only one repository is |
97 | 100 | * defined then this returns the same as getIdString() as there is no ambiguity. |
98 | 101 | */ |
— | — | @@ -179,7 +182,7 @@ |
180 | 183 | } |
181 | 184 | return true; |
182 | 185 | } |
183 | | - |
| 186 | + |
184 | 187 | /** |
185 | 188 | * Quickie protection against huuuuuuuuge batch inserts |
186 | 189 | */ |
— | — | @@ -313,7 +316,9 @@ |
314 | 317 | foreach ( $res as $row ) { |
315 | 318 | $user = $this->mRepo->authorWikiUser( $row->cr_author ); |
316 | 319 | // User must exist on wiki and have a valid email addy |
317 | | - if ( !$user || !$user->canReceiveEmail() ) continue; |
| 320 | + if ( !$user || !$user->canReceiveEmail() ) { |
| 321 | + continue; |
| 322 | + } |
318 | 323 | // Send message in receiver's language |
319 | 324 | $lang = array( 'language' => $user->getOption( 'language' ) ); |
320 | 325 | $user->sendMail( |
— | — | @@ -508,7 +513,7 @@ |
509 | 514 | } |
510 | 515 | return $users; |
511 | 516 | } |
512 | | - |
| 517 | + |
513 | 518 | public function getReferences() { |
514 | 519 | $refs = array(); |
515 | 520 | $dbr = wfGetDB( DB_SLAVE ); |
Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -181,12 +181,12 @@ |
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
185 | | - * Like getRevIdString(), but if more than one repository is defined |
| 185 | + * Like getRevIdString(), but if more than one repository is defined |
186 | 186 | * on the wiki then it includes the repo name as a prefix to the revision ID |
187 | 187 | * (separated with a period). |
188 | | - * This ensures you get a unique reference, as the revision ID alone can be |
| 188 | + * This ensures you get a unique reference, as the revision ID alone can be |
189 | 189 | * confusing (e.g. in e-mails, page titles etc.). If only one repository is |
190 | | - * defined then this returns the same as getRevIdString() as there |
| 190 | + * defined then this returns the same as getRevIdString() as there |
191 | 191 | * is no ambiguity. |
192 | 192 | */ |
193 | 193 | public function getRevIdStringUnique( $id ) { |
— | — | @@ -267,7 +267,7 @@ |
268 | 268 | wfProfileOut( __METHOD__ ); |
269 | 269 | return $data; |
270 | 270 | } |
271 | | - |
| 271 | + |
272 | 272 | /** |
273 | 273 | * Set diff cache (for import operations) |
274 | 274 | * @param $codeRev CodeRevision |
— | — | @@ -394,7 +394,7 @@ |
395 | 395 | $res = false; |
396 | 396 | return self::$userLinks[$author] = $res; |
397 | 397 | } |
398 | | - |
| 398 | + |
399 | 399 | /* |
400 | 400 | * returns an author name if $name wikiuser has an author associated, |
401 | 401 | * or false |
— | — | @@ -402,7 +402,7 @@ |
403 | 403 | public function wikiUserAuthor( $name ) { |
404 | 404 | if ( isset( self::$authorLinks[$name] ) ) |
405 | 405 | return self::$authorLinks[$name]; |
406 | | - |
| 406 | + |
407 | 407 | $dbr = wfGetDB( DB_SLAVE ); |
408 | 408 | $res = $dbr->selectField( |
409 | 409 | 'code_authors', |
Index: trunk/extensions/CodeReview/backend/RepoStats.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | private $repo; |
6 | 6 | |
7 | 7 | public $time; |
8 | | - |
| 8 | + |
9 | 9 | // Statistics |
10 | 10 | public $revisions, |
11 | 11 | $authors, |
Index: trunk/extensions/CodeReview/backend/DiffHighlighter.php |
— | — | @@ -37,7 +37,9 @@ |
38 | 38 | * @return string |
39 | 39 | */ |
40 | 40 | function colorLine( $line ) { |
41 | | - if ( $line == '' ) return ""; // don't create bogus spans |
| 41 | + if ( $line == '' ) { |
| 42 | + return ""; // don't create bogus spans |
| 43 | + } |
42 | 44 | list( $element, $attribs ) = $this->tagForLine( $line ); |
43 | 45 | return Xml::element( $element, $attribs, $line ); |
44 | 46 | } |
Index: trunk/extensions/CodeReview/ui/CodeRevisionAuthorLink.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | $wgOut->addWikiMsg( 'code-author-badtoken' ); |
68 | 68 | return; |
69 | 69 | } |
70 | | - |
| 70 | + |
71 | 71 | if ( strlen( $this->mTarget ) && $wgRequest->getCheck( 'newname' ) ) { |
72 | 72 | $user = User::newFromName( $this->mTarget, false ); |
73 | 73 | if ( !$user || !$user->getId() ) { |
Index: trunk/extensions/CodeReview/ui/CodeRevisionAuthorView.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | |
46 | 46 | parent::execute(); |
47 | 47 | } |
48 | | - |
| 48 | + |
49 | 49 | function getSpecializedWhereClause( $dbr ) { |
50 | 50 | return array( 'cr_author' => $this->mAuthor ); |
51 | 51 | } |
Index: trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | if ( $this->validPost( 'codereview-post-comment' ) && strlen( $this->text ) ) { |
45 | 45 | $parent = $wgRequest->getIntOrNull( 'wpParent' ); |
46 | 46 | $review = $wgRequest->getInt( 'wpReview' ); |
47 | | - //$isPreview = $wgRequest->getCheck( 'wpPreview' ); |
| 47 | + // $isPreview = $wgRequest->getCheck( 'wpPreview' ); |
48 | 48 | $id = $this->mRev->saveComment( $this->text, $review, $parent ); |
49 | 49 | // For comments, take us back to the rev page focused on the new comment |
50 | 50 | if ( !$this->jumpToNext ) { |
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -31,11 +31,11 @@ |
32 | 32 | } |
33 | 33 | |
34 | 34 | $this->showForm(); |
35 | | - |
| 35 | + |
36 | 36 | // Get the total count across all pages |
37 | 37 | $dbr = wfGetDB( DB_SLAVE ); |
38 | 38 | $revCount = $this->getRevCount( $dbr ); |
39 | | - |
| 39 | + |
40 | 40 | $pager = $this->getPager(); |
41 | 41 | |
42 | 42 | // Build batch change interface as needed |
— | — | @@ -169,11 +169,11 @@ |
170 | 170 | function getPager() { |
171 | 171 | return new SvnRevTablePager( $this ); |
172 | 172 | } |
173 | | - |
| 173 | + |
174 | 174 | /** |
175 | 175 | * Get total number of revisions for this revision view |
176 | | - * |
177 | | - * @return int Number of revisions |
| 176 | + * |
| 177 | + * @return int Number of revisions |
178 | 178 | */ |
179 | 179 | function getRevCount( $dbr ) { |
180 | 180 | $tables = array( 'code_rev' ); |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | else |
201 | 201 | return 0; |
202 | 202 | } |
203 | | - |
| 203 | + |
204 | 204 | /** |
205 | 205 | * @todo Document |
206 | 206 | */ |
— | — | @@ -288,7 +288,7 @@ |
289 | 289 | } |
290 | 290 | return $fields; |
291 | 291 | } |
292 | | - |
| 292 | + |
293 | 293 | function formatValue( $name, $value ) { } // unused |
294 | 294 | |
295 | 295 | function formatRevValue( $name, $value, $row ) { |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -181,7 +181,7 @@ |
182 | 182 | } |
183 | 183 | return false; |
184 | 184 | } |
185 | | - |
| 185 | + |
186 | 186 | protected function canPostComments() { |
187 | 187 | global $wgUser; |
188 | 188 | return $wgUser->isAllowed( 'codereview-post-comment' ) && !$wgUser->isBlocked(); |
— | — | @@ -324,7 +324,7 @@ |
325 | 325 | return $hilite->render( $diff ); |
326 | 326 | } |
327 | 327 | } |
328 | | - |
| 328 | + |
329 | 329 | protected function formatImgDiff() { |
330 | 330 | global $wgCodeReviewImgRegex; |
331 | 331 | // Get image diffs |
— | — | @@ -356,7 +356,7 @@ |
357 | 357 | } |
358 | 358 | return $html; |
359 | 359 | } |
360 | | - |
| 360 | + |
361 | 361 | protected function formatImgCell( $path, $rev, $message ) { |
362 | 362 | $viewvc = $this->mRepo->getViewVcBase(); |
363 | 363 | $safePath = wfUrlEncode( $path ); |
— | — | @@ -412,7 +412,7 @@ |
413 | 413 | } |
414 | 414 | return "<ul class='mw-codereview-changes'>$changes</ul>"; |
415 | 415 | } |
416 | | - |
| 416 | + |
417 | 417 | protected function formatReferences() { |
418 | 418 | $refs = implode( "\n", |
419 | 419 | array_map( array( $this, 'formatReferenceInline' ), $this->mRev->getReferences() ) |
— | — | @@ -472,7 +472,7 @@ |
473 | 473 | $line .= "]</i>"; |
474 | 474 | return "<li>$line</li>"; |
475 | 475 | } |
476 | | - |
| 476 | + |
477 | 477 | protected function formatReferenceInline( $row ) { |
478 | 478 | global $wgLang; |
479 | 479 | $rev = intval( $row->cr_id ); |
Index: trunk/extensions/CodeReview/ui/CodeRevisionStatusView.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | function getPager() { |
12 | 12 | return new SvnRevStatusTablePager( $this, $this->mStatus ); |
13 | 13 | } |
14 | | - |
| 14 | + |
15 | 15 | function getSpecializedWhereClause( $dbr ) { |
16 | 16 | return array( 'cr_status' => $this->mStatus ); |
17 | 17 | } |