Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -412,12 +412,14 @@ |
413 | 413 | __METHOD__ |
414 | 414 | ); |
415 | 415 | $user = null; |
416 | | - if ( $wikiUser !== false ) |
| 416 | + if ( $wikiUser !== false ) { |
417 | 417 | $user = User::newFromName( $wikiUser ); |
418 | | - if ( $user instanceof User ) |
| 418 | + } |
| 419 | + if ( $user instanceof User ){ |
419 | 420 | $res = $user; |
420 | | - else |
| 421 | + } else { |
421 | 422 | $res = false; |
| 423 | + } |
422 | 424 | return self::$userLinks[$author] = $res; |
423 | 425 | } |
424 | 426 | |
Index: trunk/extensions/CodeReview/backend/DiffHighlighter.php |
— | — | @@ -58,10 +58,11 @@ |
59 | 59 | ' ' => array( 'span', array() ), |
60 | 60 | ); |
61 | 61 | $first = substr( $line, 0, 1 ); |
62 | | - if ( isset( $tags[$first] ) ) |
| 62 | + if ( isset( $tags[$first] ) ) { |
63 | 63 | return $tags[$first]; |
64 | | - else |
| 64 | + } else { |
65 | 65 | return $default; |
| 66 | + } |
66 | 67 | } |
67 | 68 | |
68 | 69 | } |
Index: trunk/extensions/CodeReview/ui/SpecialCode.php |
— | — | @@ -72,10 +72,11 @@ |
73 | 73 | break; |
74 | 74 | } else { |
75 | 75 | # Nonsense parameters, back out |
76 | | - if ( empty( $params[1] ) ) |
| 76 | + if ( empty( $params[1] ) ) { |
77 | 77 | $view = new CodeRevisionListView( $params[0] ); |
78 | | - else |
| 78 | + } else { |
79 | 79 | $view = new CodeRevisionView( $params[0], $params[1] ); |
| 80 | + } |
80 | 81 | break; |
81 | 82 | } |
82 | 83 | case 4: |
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -97,8 +97,9 @@ |
98 | 98 | // This way of getting GET parameters is horrible, but effective. |
99 | 99 | $fields = $wgRequest->getValues(); |
100 | 100 | foreach ( array_keys( $fields ) as $key ) { |
101 | | - if ( substr( $key, 0, 2 ) == 'wp' || $key == 'title' ) |
| 101 | + if ( substr( $key, 0, 2 ) == 'wp' || $key == 'title' ) { |
102 | 102 | unset( $fields[$key] ); |
| 103 | + } |
103 | 104 | } |
104 | 105 | |
105 | 106 | global $wgOut; |
— | — | @@ -125,7 +126,9 @@ |
126 | 127 | $changeFields['code-batch-tags'] = CodeRevisionView::addTagForm( '', '' ); |
127 | 128 | } |
128 | 129 | |
129 | | - if ( !count( $changeFields ) ) return ''; // nothing to do here |
| 130 | + if ( !count( $changeFields ) ) { |
| 131 | + return ''; // nothing to do here |
| 132 | + } |
130 | 133 | |
131 | 134 | $changeInterface = Xml::fieldset( wfMsg( 'codereview-batch-title' ), |
132 | 135 | Xml::buildForm( $changeFields, 'codereview-batch-submit' ) ); |
— | — | @@ -194,10 +197,11 @@ |
195 | 198 | } |
196 | 199 | $whereCond = array_merge( $whereCond, $this->getSpecializedWhereClause( $dbr ) ); |
197 | 200 | $result = $dbr->selectRow( $tables, $selectFields, $whereCond ); |
198 | | - if ( $result ) |
| 201 | + if ( $result ) { |
199 | 202 | return $result->rev_count; |
200 | | - else |
| 203 | + } else { |
201 | 204 | return 0; |
| 205 | + } |
202 | 206 | } |
203 | 207 | |
204 | 208 | /** |
— | — | @@ -257,7 +261,6 @@ |
258 | 262 | ) |
259 | 263 | ); |
260 | 264 | } |
261 | | - return false; |
262 | 265 | } |
263 | 266 | |
264 | 267 | function getSelectFields() { |
Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php |
— | — | @@ -149,18 +149,22 @@ |
150 | 150 | // Quick relevance tests (these *should* be over-inclusive a little if anything) |
151 | 151 | private function isRelevant( $summary, $whole = true ) { |
152 | 152 | # 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 ) ) { |
154 | 154 | return true; |
| 155 | + } |
155 | 156 | # Sanity check: summary cannot be *too* short to be useful |
156 | 157 | $words = str_word_count( $summary ); |
157 | | - if ( mb_strlen( $summary ) < 40 || $words <= 5 ) |
| 158 | + if ( mb_strlen( $summary ) < 40 || $words <= 5 ) { |
158 | 159 | return false; |
| 160 | + } |
159 | 161 | # 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 ) ) { |
161 | 163 | return true; |
| 164 | + } |
162 | 165 | # 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 ) ) { |
164 | 167 | return true; |
| 168 | + } |
165 | 169 | # Are we looking at the whole summary or an aspect of it? |
166 | 170 | if ( $whole ) { |
167 | 171 | return preg_match( '/(^|\n) ?\*/', $summary ); # List of items? |