Index: trunk/phase3/tests/phpunit/includes/ImageFunctionsTest.php |
— | — | @@ -32,7 +32,9 @@ |
33 | 33 | 17 => 4, |
34 | 34 | 18 => 4 ) ) ); |
35 | 35 | foreach ( $vals as $row ) { |
36 | | - extract( $row ); |
| 36 | + $tests = $row['tests']; |
| 37 | + $height = $row['height']; |
| 38 | + $width = $row['width']; |
37 | 39 | foreach ( $tests as $max => $expected ) { |
38 | 40 | $y = round( $expected * $height / $width ); |
39 | 41 | $result = wfFitBoxWidth( $width, $height, $max ); |
Index: trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php |
3 | | -/* |
| 3 | +/* |
4 | 4 | * Unit tests for wfExpandUrl() |
5 | 5 | */ |
6 | 6 | |
— | — | @@ -11,6 +11,8 @@ |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Provider of URL examples for testing wfExpandUrl() |
| 15 | + * |
| 16 | + * @return array |
15 | 17 | */ |
16 | 18 | public function provideExpandableUrls() { |
17 | 19 | global $wgServer; |
Index: trunk/phase3/includes/upload/UploadFromUrl.php |
— | — | @@ -19,10 +19,13 @@ |
20 | 20 | * user is allowed, pass on permissions checking to the parent. |
21 | 21 | * |
22 | 22 | * @param $user User |
| 23 | + * |
| 24 | + * @return bool |
23 | 25 | */ |
24 | 26 | public static function isAllowed( $user ) { |
25 | | - if ( !$user->isAllowed( 'upload_by_url' ) ) |
| 27 | + if ( !$user->isAllowed( 'upload_by_url' ) ) { |
26 | 28 | return 'upload_by_url'; |
| 29 | + } |
27 | 30 | return parent::isAllowed( $user ); |
28 | 31 | } |
29 | 32 | |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4190,10 +4190,10 @@ |
4191 | 4191 | # split up and insert constructed headlines |
4192 | 4192 | $blocks = preg_split( '/<H[1-6].*?' . '>.*?<\/H[1-6]>/i', $text ); |
4193 | 4193 | $i = 0; |
4194 | | - |
| 4194 | + |
4195 | 4195 | // build an array of document sections |
4196 | 4196 | $sections = array(); |
4197 | | - foreach ( $blocks as $block ) { |
| 4197 | + foreach ( $blocks as $block ) { |
4198 | 4198 | // $head is zero-based, sections aren't. |
4199 | 4199 | if ( empty( $head[$i - 1] ) ) { |
4200 | 4200 | $sections[$i] = $block; |
— | — | @@ -4212,7 +4212,7 @@ |
4213 | 4213 | * $showEditLinks : boolean describing whether this section has an edit link |
4214 | 4214 | */ |
4215 | 4215 | wfRunHooks( 'ParserSectionCreate', array( $this, $i, &$sections[$i], $showEditLink ) ); |
4216 | | - |
| 4216 | + |
4217 | 4217 | $i++; |
4218 | 4218 | } |
4219 | 4219 | |
— | — | @@ -4221,9 +4221,9 @@ |
4222 | 4222 | // Top anchor now in skin |
4223 | 4223 | $sections[0] = $sections[0] . $toc . "\n"; |
4224 | 4224 | } |
4225 | | - |
| 4225 | + |
4226 | 4226 | $full .= join( '', $sections ); |
4227 | | - |
| 4227 | + |
4228 | 4228 | if ( $this->mForceTocPosition ) { |
4229 | 4229 | return str_replace( '<!--MWTOC-->', $toc, $full ); |
4230 | 4230 | } else { |
— | — | @@ -5128,6 +5128,10 @@ |
5129 | 5129 | * |
5130 | 5130 | * Transparent tag hooks are like regular XML-style tag hooks, except they |
5131 | 5131 | * operate late in the transformation sequence, on HTML instead of wikitext. |
| 5132 | + * |
| 5133 | + * @param $text string |
| 5134 | + * |
| 5135 | + * @return string |
5132 | 5136 | */ |
5133 | 5137 | function replaceTransparentTags( $text ) { |
5134 | 5138 | $matches = array(); |
— | — | @@ -5414,6 +5418,10 @@ |
5415 | 5419 | * Try to guess the section anchor name based on a wikitext fragment |
5416 | 5420 | * presumably extracted from a heading, for example "Header" from |
5417 | 5421 | * "== Header ==". |
| 5422 | + * |
| 5423 | + * @param $text string |
| 5424 | + * |
| 5425 | + * @return string |
5418 | 5426 | */ |
5419 | 5427 | public function guessSectionNameFromWikiText( $text ) { |
5420 | 5428 | # Strip out wikitext links(they break the anchor) |
Index: trunk/phase3/includes/parser/Preprocessor_HipHop.hphp |
— | — | @@ -260,8 +260,8 @@ |
261 | 261 | if ( $found === 'angle' ) { |
262 | 262 | $matches = false; |
263 | 263 | // Handle </onlyinclude> |
264 | | - if ( $enableOnlyinclude |
265 | | - && substr( $text, $i, strlen( '</onlyinclude>' ) ) === '</onlyinclude>' ) |
| 264 | + if ( $enableOnlyinclude |
| 265 | + && substr( $text, $i, strlen( '</onlyinclude>' ) ) === '</onlyinclude>' ) |
266 | 266 | { |
267 | 267 | $findOnlyinclude = true; |
268 | 268 | continue; |
— | — | @@ -362,7 +362,7 @@ |
363 | 363 | } |
364 | 364 | |
365 | 365 | $tagStartPos = $i; |
366 | | - $inner = $close = ''; |
| 366 | + $close = ''; |
367 | 367 | if ( $text[$tagEndPos-1] === '/' ) { |
368 | 368 | // Short end tag |
369 | 369 | $attrEnd = $tagEndPos - 1; |
Index: trunk/phase3/includes/parser/ParserCache.php |
— | — | @@ -15,6 +15,8 @@ |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Get an instance of this object |
| 19 | + * |
| 20 | + * @return ParserCache |
19 | 21 | */ |
20 | 22 | public static function singleton() { |
21 | 23 | static $instance; |
Index: trunk/phase3/includes/PatrolLog.php |
— | — | @@ -13,6 +13,8 @@ |
14 | 14 | * |
15 | 15 | * @param $rc Mixed: change identifier or RecentChange object |
16 | 16 | * @param $auto Boolean: was this patrol event automatic? |
| 17 | + * |
| 18 | + * @return bool |
17 | 19 | */ |
18 | 20 | public static function record( $rc, $auto = false ) { |
19 | 21 | if( !( $rc instanceof RecentChange ) ) { |
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | static $skin = null, $infinity = null; |
85 | 85 | |
86 | 86 | if( is_null( $skin ) ){ |
87 | | - $skin = $wgUser->getSkin(); |
| 87 | + $skin = $this->getSkin(); |
88 | 88 | $infinity = wfGetDB( DB_SLAVE )->getInfinity(); |
89 | 89 | } |
90 | 90 | |
Index: trunk/phase3/includes/WikiCategoryPage.php |
— | — | @@ -6,6 +6,8 @@ |
7 | 7 | /** |
8 | 8 | * Constructor from a page id |
9 | 9 | * @param $id Int article ID to load |
| 10 | + * |
| 11 | + * @return WikiCategoryPage |
10 | 12 | */ |
11 | 13 | public static function newFromID( $id ) { |
12 | 14 | $t = Title::newFromID( $id ); |
— | — | @@ -18,6 +20,8 @@ |
19 | 21 | * Don't return a 404 for categories in use. |
20 | 22 | * In use defined as: either the actual page exists |
21 | 23 | * or the category currently has members. |
| 24 | + * |
| 25 | + * @return bool |
22 | 26 | */ |
23 | 27 | public function hasViewableContent() { |
24 | 28 | if ( parent::hasViewableContent() ) { |