r72062 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72061‎ | r72062 | r72063 >
Date:23:08, 31 August 2010
Author:reedy
Status:ok
Tags:
Comment:
More braces
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRepository.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/DiffHighlighter.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeReleaseNotes.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRepository.php
@@ -412,12 +412,14 @@
413413 __METHOD__
414414 );
415415 $user = null;
416 - if ( $wikiUser !== false )
 416+ if ( $wikiUser !== false ) {
417417 $user = User::newFromName( $wikiUser );
418 - if ( $user instanceof User )
 418+ }
 419+ if ( $user instanceof User ){
419420 $res = $user;
420 - else
 421+ } else {
421422 $res = false;
 423+ }
422424 return self::$userLinks[$author] = $res;
423425 }
424426
Index: trunk/extensions/CodeReview/backend/DiffHighlighter.php
@@ -58,10 +58,11 @@
5959 ' ' => array( 'span', array() ),
6060 );
6161 $first = substr( $line, 0, 1 );
62 - if ( isset( $tags[$first] ) )
 62+ if ( isset( $tags[$first] ) ) {
6363 return $tags[$first];
64 - else
 64+ } else {
6565 return $default;
 66+ }
6667 }
6768
6869 }
Index: trunk/extensions/CodeReview/ui/SpecialCode.php
@@ -72,10 +72,11 @@
7373 break;
7474 } else {
7575 # Nonsense parameters, back out
76 - if ( empty( $params[1] ) )
 76+ if ( empty( $params[1] ) ) {
7777 $view = new CodeRevisionListView( $params[0] );
78 - else
 78+ } else {
7979 $view = new CodeRevisionView( $params[0], $params[1] );
 80+ }
8081 break;
8182 }
8283 case 4:
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -97,8 +97,9 @@
9898 // This way of getting GET parameters is horrible, but effective.
9999 $fields = $wgRequest->getValues();
100100 foreach ( array_keys( $fields ) as $key ) {
101 - if ( substr( $key, 0, 2 ) == 'wp' || $key == 'title' )
 101+ if ( substr( $key, 0, 2 ) == 'wp' || $key == 'title' ) {
102102 unset( $fields[$key] );
 103+ }
103104 }
104105
105106 global $wgOut;
@@ -125,7 +126,9 @@
126127 $changeFields['code-batch-tags'] = CodeRevisionView::addTagForm( '', '' );
127128 }
128129
129 - if ( !count( $changeFields ) ) return ''; // nothing to do here
 130+ if ( !count( $changeFields ) ) {
 131+ return ''; // nothing to do here
 132+ }
130133
131134 $changeInterface = Xml::fieldset( wfMsg( 'codereview-batch-title' ),
132135 Xml::buildForm( $changeFields, 'codereview-batch-submit' ) );
@@ -194,10 +197,11 @@
195198 }
196199 $whereCond = array_merge( $whereCond, $this->getSpecializedWhereClause( $dbr ) );
197200 $result = $dbr->selectRow( $tables, $selectFields, $whereCond );
198 - if ( $result )
 201+ if ( $result ) {
199202 return $result->rev_count;
200 - else
 203+ } else {
201204 return 0;
 205+ }
202206 }
203207
204208 /**
@@ -257,7 +261,6 @@
258262 )
259263 );
260264 }
261 - return false;
262265 }
263266
264267 function getSelectFields() {
Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php
@@ -149,18 +149,22 @@
150150 // Quick relevance tests (these *should* be over-inclusive a little if anything)
151151 private function isRelevant( $summary, $whole = true ) {
152152 # Fixed a bug? Mentioned a config var?
153 - if ( preg_match( '/\b(bug #?(\d+)|\$[we]g[0-9a-z]{3,50})\b/i', $summary ) )
 153+ if ( preg_match( '/\b(bug #?(\d+)|\$[we]g[0-9a-z]{3,50})\b/i', $summary ) ) {
154154 return true;
 155+ }
155156 # Sanity check: summary cannot be *too* short to be useful
156157 $words = str_word_count( $summary );
157 - if ( mb_strlen( $summary ) < 40 || $words <= 5 )
 158+ if ( mb_strlen( $summary ) < 40 || $words <= 5 ) {
158159 return false;
 160+ }
159161 # All caps words (like "BREAKING CHANGE"/magic words)?
160 - if ( preg_match( '/\b[A-Z]{6,30}\b/', $summary ) )
 162+ if ( preg_match( '/\b[A-Z]{6,30}\b/', $summary ) ) {
161163 return true;
 164+ }
162165 # Random keywords
163 - if ( preg_match( '/\b(wiki|HTML\d|CSS\d|UTF-?8|(Apache|PHP|CGI|Java|Perl|Python|\w+SQL) ?\d?\.?\d?)\b/i', $summary ) )
 166+ if ( preg_match( '/\b(wiki|HTML\d|CSS\d|UTF-?8|(Apache|PHP|CGI|Java|Perl|Python|\w+SQL) ?\d?\.?\d?)\b/i', $summary ) ) {
164167 return true;
 168+ }
165169 # Are we looking at the whole summary or an aspect of it?
166170 if ( $whole ) {
167171 return preg_match( '/(^|\n) ?\*/', $summary ); # List of items?

Status & tagging log