Index: trunk/phase3/includes/GenderCache.php |
— | — | @@ -10,7 +10,10 @@ |
11 | 11 | protected $default; |
12 | 12 | protected $misses = 0; |
13 | 13 | protected $missLimit = 1000; |
14 | | - |
| 14 | + |
| 15 | + /** |
| 16 | + * @return GenderCache |
| 17 | + */ |
15 | 18 | public static function singleton() { |
16 | 19 | static $that = null; |
17 | 20 | if ( $that === null ) { |
— | — | @@ -34,7 +37,7 @@ |
35 | 38 | |
36 | 39 | /** |
37 | 40 | * Returns the gender for given username. |
38 | | - * @param $users String: username |
| 41 | + * @param $username String: username |
39 | 42 | * @param $caller String: the calling method |
40 | 43 | * @return String |
41 | 44 | */ |
— | — | @@ -70,6 +73,9 @@ |
71 | 74 | |
72 | 75 | /** |
73 | 76 | * Wrapper for doQuery that processes raw LinkBatch data. |
| 77 | + * |
| 78 | + * @param $data |
| 79 | + * @param $caller |
74 | 80 | */ |
75 | 81 | public function doLinkBatch( $data, $caller = '' ) { |
76 | 82 | $users = array(); |
— | — | @@ -82,7 +88,6 @@ |
83 | 89 | } |
84 | 90 | |
85 | 91 | $this->doQuery( array_keys( $users ), $caller ); |
86 | | - |
87 | 92 | } |
88 | 93 | |
89 | 94 | /** |
Index: trunk/phase3/includes/extauth/MediaWiki.php |
— | — | @@ -50,8 +50,17 @@ |
51 | 51 | * @ingroup ExternalUser |
52 | 52 | */ |
53 | 53 | class ExternalUser_MediaWiki extends ExternalUser { |
54 | | - private $mRow, $mDb; |
| 54 | + private $mRow; |
55 | 55 | |
| 56 | + /** |
| 57 | + * @var DatabaseBase |
| 58 | + */ |
| 59 | + private $mDb; |
| 60 | + |
| 61 | + /** |
| 62 | + * @param $name string |
| 63 | + * @return bool |
| 64 | + */ |
56 | 65 | protected function initFromName( $name ) { |
57 | 66 | # We might not need the 'usable' bit, but let's be safe. Theoretically |
58 | 67 | # this might return wrong results for old versions, but it's probably |
— | — | @@ -65,10 +74,18 @@ |
66 | 75 | return $this->initFromCond( array( 'user_name' => $name ) ); |
67 | 76 | } |
68 | 77 | |
| 78 | + /** |
| 79 | + * @param $id int |
| 80 | + * @return bool |
| 81 | + */ |
69 | 82 | protected function initFromId( $id ) { |
70 | 83 | return $this->initFromCond( array( 'user_id' => $id ) ); |
71 | 84 | } |
72 | 85 | |
| 86 | + /** |
| 87 | + * @param $cond array |
| 88 | + * @return bool |
| 89 | + */ |
73 | 90 | private function initFromCond( $cond ) { |
74 | 91 | global $wgExternalAuthConf; |
75 | 92 | |
— | — | @@ -105,6 +122,9 @@ |
106 | 123 | return $this->mRow->user_id; |
107 | 124 | } |
108 | 125 | |
| 126 | + /** |
| 127 | + * @return string |
| 128 | + */ |
109 | 129 | public function getName() { |
110 | 130 | return $this->mRow->user_name; |
111 | 131 | } |
— | — | @@ -126,6 +146,9 @@ |
127 | 147 | return null; |
128 | 148 | } |
129 | 149 | |
| 150 | + /** |
| 151 | + * @return array |
| 152 | + */ |
130 | 153 | public function getGroups() { |
131 | 154 | # @todo FIXME: Untested. |
132 | 155 | $groups = array(); |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -41,6 +41,9 @@ |
42 | 42 | 'CREATE TEMPORARY TABLES', |
43 | 43 | ); |
44 | 44 | |
| 45 | + /** |
| 46 | + * @return string |
| 47 | + */ |
45 | 48 | public function getName() { |
46 | 49 | return 'mysql'; |
47 | 50 | } |
— | — | @@ -49,14 +52,23 @@ |
50 | 53 | parent::__construct( $parent ); |
51 | 54 | } |
52 | 55 | |
| 56 | + /** |
| 57 | + * @return Bool |
| 58 | + */ |
53 | 59 | public function isCompiled() { |
54 | 60 | return self::checkExtension( 'mysql' ); |
55 | 61 | } |
56 | 62 | |
| 63 | + /** |
| 64 | + * @return array |
| 65 | + */ |
57 | 66 | public function getGlobalDefaults() { |
58 | 67 | return array(); |
59 | 68 | } |
60 | 69 | |
| 70 | + /** |
| 71 | + * @return string |
| 72 | + */ |
61 | 73 | public function getConnectForm() { |
62 | 74 | return |
63 | 75 | $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . |
— | — | @@ -111,6 +123,9 @@ |
112 | 124 | return $status; |
113 | 125 | } |
114 | 126 | |
| 127 | + /** |
| 128 | + * @return Status |
| 129 | + */ |
115 | 130 | public function openConnection() { |
116 | 131 | $status = Status::newGood(); |
117 | 132 | try { |
— | — | @@ -187,6 +202,8 @@ |
188 | 203 | |
189 | 204 | /** |
190 | 205 | * Get a list of storage engines that are available and supported |
| 206 | + * |
| 207 | + * @return array |
191 | 208 | */ |
192 | 209 | public function getEngines() { |
193 | 210 | $engines = array( 'InnoDB', 'MyISAM' ); |
— | — | @@ -215,6 +232,8 @@ |
216 | 233 | |
217 | 234 | /** |
218 | 235 | * Get a list of character sets that are available and supported |
| 236 | + * |
| 237 | + * @return array |
219 | 238 | */ |
220 | 239 | public function getCharsets() { |
221 | 240 | $status = $this->getConnection(); |
— | — | @@ -231,6 +250,8 @@ |
232 | 251 | |
233 | 252 | /** |
234 | 253 | * Return true if the install user can create accounts |
| 254 | + * |
| 255 | + * @return bool |
235 | 256 | */ |
236 | 257 | public function canCreateAccounts() { |
237 | 258 | $status = $this->getConnection(); |
— | — | @@ -304,6 +325,9 @@ |
305 | 326 | return true; |
306 | 327 | } |
307 | 328 | |
| 329 | + /** |
| 330 | + * @return string |
| 331 | + */ |
308 | 332 | public function getSettingsForm() { |
309 | 333 | if ( $this->canCreateAccounts() ) { |
310 | 334 | $noCreateMsg = false; |
— | — | @@ -368,6 +392,9 @@ |
369 | 393 | return $s; |
370 | 394 | } |
371 | 395 | |
| 396 | + /** |
| 397 | + * @return Status |
| 398 | + */ |
372 | 399 | public function submitSettingsForm() { |
373 | 400 | $this->setVarsFromRequest( array( '_MysqlEngine', '_MysqlCharset' ) ); |
374 | 401 | $status = $this->submitWebUserBox(); |
— | — | @@ -423,6 +450,9 @@ |
424 | 451 | $this->parent->addInstallStep( $callback, 'tables' ); |
425 | 452 | } |
426 | 453 | |
| 454 | + /** |
| 455 | + * @return Status |
| 456 | + */ |
427 | 457 | public function setupDatabase() { |
428 | 458 | $status = $this->getConnection(); |
429 | 459 | if ( !$status->isOK() ) { |
— | — | @@ -438,6 +468,9 @@ |
439 | 469 | return $status; |
440 | 470 | } |
441 | 471 | |
| 472 | + /** |
| 473 | + * @return Status |
| 474 | + */ |
442 | 475 | public function setupUser() { |
443 | 476 | $dbUser = $this->getVar( 'wgDBuser' ); |
444 | 477 | if( $dbUser == $this->getVar( '_InstallUser' ) ) { |
— | — | @@ -580,6 +613,8 @@ |
581 | 614 | |
582 | 615 | /** |
583 | 616 | * Get variables to substitute into tables.sql and the SQL patch files. |
| 617 | + * |
| 618 | + * @return array |
584 | 619 | */ |
585 | 620 | public function getSchemaVars() { |
586 | 621 | return array( |
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php |
— | — | @@ -27,10 +27,17 @@ |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
| 31 | + /** |
| 32 | + * @return PPFrame_DOM |
| 33 | + */ |
31 | 34 | function newFrame() { |
32 | 35 | return new PPFrame_DOM( $this ); |
33 | 36 | } |
34 | 37 | |
| 38 | + /** |
| 39 | + * @param $args |
| 40 | + * @return PPCustomFrame_DOM |
| 41 | + */ |
35 | 42 | function newCustomFrame( $args ) { |
36 | 43 | return new PPCustomFrame_DOM( $this, $args ); |
37 | 44 | } |
Index: trunk/phase3/includes/specials/SpecialDisambiguations.php |
— | — | @@ -102,7 +102,9 @@ |
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | | - * Fetch links and cache their existence |
| 106 | + * Fetch links and cache their existence |
| 107 | + * |
| 108 | + * @param $db DatabaseBase |
107 | 109 | */ |
108 | 110 | function preprocessResults( $db, $res ) { |
109 | 111 | $batch = new LinkBatch; |
Index: trunk/phase3/includes/specials/SpecialBrokenRedirects.php |
— | — | @@ -64,10 +64,18 @@ |
65 | 65 | ); |
66 | 66 | } |
67 | 67 | |
| 68 | + /** |
| 69 | + * @return array |
| 70 | + */ |
68 | 71 | function getOrderFields() { |
69 | 72 | return array ( 'rd_namespace', 'rd_title', 'rd_from' ); |
70 | 73 | } |
71 | 74 | |
| 75 | + /** |
| 76 | + * @param $skin Skin |
| 77 | + * @param $result |
| 78 | + * @return String |
| 79 | + */ |
72 | 80 | function formatResult( $skin, $result ) { |
73 | 81 | global $wgUser, $wgContLang, $wgLang; |
74 | 82 | |
— | — | @@ -101,7 +109,7 @@ |
102 | 110 | array(), |
103 | 111 | array( 'action' => 'edit' ) |
104 | 112 | ); |
105 | | - $to = $skin->link( |
| 113 | + $to = $skin->link( |
106 | 114 | $toObj, |
107 | 115 | null, |
108 | 116 | array(), |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | |
111 | 111 | /** |
112 | 112 | * @todo document |
113 | | - * @param $article |
| 113 | + * @param $article Article |
114 | 114 | */ |
115 | 115 | function __construct( $article ) { |
116 | 116 | $this->mArticle =& $article; |
— | — | @@ -128,6 +128,9 @@ |
129 | 129 | $this->mPreloadText = ""; |
130 | 130 | } |
131 | 131 | |
| 132 | + /** |
| 133 | + * @return Article |
| 134 | + */ |
132 | 135 | function getArticle() { |
133 | 136 | return $this->mArticle; |
134 | 137 | } |
Index: trunk/phase3/includes/media/DjVu.php |
— | — | @@ -12,6 +12,10 @@ |
13 | 13 | * @ingroup Media |
14 | 14 | */ |
15 | 15 | class DjVuHandler extends ImageHandler { |
| 16 | + |
| 17 | + /** |
| 18 | + * @return bool |
| 19 | + */ |
16 | 20 | function isEnabled() { |
17 | 21 | global $wgDjvuRenderer, $wgDjvuDump, $wgDjvuToXML; |
18 | 22 | if ( !$wgDjvuRenderer || ( !$wgDjvuDump && !$wgDjvuToXML ) ) { |
— | — | @@ -22,9 +26,25 @@ |
23 | 27 | } |
24 | 28 | } |
25 | 29 | |
26 | | - function mustRender( $file ) { return true; } |
27 | | - function isMultiPage( $file ) { return true; } |
| 30 | + /** |
| 31 | + * @param $file |
| 32 | + * @return bool |
| 33 | + */ |
| 34 | + function mustRender( $file ) { |
| 35 | + return true; |
| 36 | + } |
28 | 37 | |
| 38 | + /** |
| 39 | + * @param $file |
| 40 | + * @return bool |
| 41 | + */ |
| 42 | + function isMultiPage( $file ) { |
| 43 | + return true; |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * @return array |
| 48 | + */ |
29 | 49 | function getParamMap() { |
30 | 50 | return array( |
31 | 51 | 'img_width' => 'width', |
— | — | @@ -32,6 +52,11 @@ |
33 | 53 | ); |
34 | 54 | } |
35 | 55 | |
| 56 | + /** |
| 57 | + * @param $name |
| 58 | + * @param $value |
| 59 | + * @return bool |
| 60 | + */ |
36 | 61 | function validateParam( $name, $value ) { |
37 | 62 | if ( in_array( $name, array( 'width', 'height', 'page' ) ) ) { |
38 | 63 | if ( $value <= 0 ) { |
— | — | @@ -44,6 +69,10 @@ |
45 | 70 | } |
46 | 71 | } |
47 | 72 | |
| 73 | + /** |
| 74 | + * @param $params |
| 75 | + * @return bool|string |
| 76 | + */ |
48 | 77 | function makeParamString( $params ) { |
49 | 78 | $page = isset( $params['page'] ) ? $params['page'] : 1; |
50 | 79 | if ( !isset( $params['width'] ) ) { |
— | — | @@ -52,6 +81,10 @@ |
53 | 82 | return "page{$page}-{$params['width']}px"; |
54 | 83 | } |
55 | 84 | |
| 85 | + /** |
| 86 | + * @param $str |
| 87 | + * @return array|bool |
| 88 | + */ |
56 | 89 | function parseParamString( $str ) { |
57 | 90 | $m = false; |
58 | 91 | if ( preg_match( '/^page(\d+)-(\d+)px$/', $str, $m ) ) { |
— | — | @@ -61,6 +94,10 @@ |
62 | 95 | } |
63 | 96 | } |
64 | 97 | |
| 98 | + /** |
| 99 | + * @param $params |
| 100 | + * @return array |
| 101 | + */ |
65 | 102 | function getScriptParams( $params ) { |
66 | 103 | return array( |
67 | 104 | 'width' => $params['width'], |
— | — | @@ -133,6 +170,8 @@ |
134 | 171 | |
135 | 172 | /** |
136 | 173 | * Cache an instance of DjVuImage in an Image object, return that instance |
| 174 | + * |
| 175 | + * @return DjVuImage |
137 | 176 | */ |
138 | 177 | function getDjVuImage( $image, $path ) { |
139 | 178 | if ( !$image ) { |
Index: trunk/phase3/includes/media/PNG.php |
— | — | @@ -31,7 +31,11 @@ |
32 | 32 | |
33 | 33 | return serialize($metadata); |
34 | 34 | } |
35 | | - |
| 35 | + |
| 36 | + /** |
| 37 | + * @param $image File |
| 38 | + * @return array|bool |
| 39 | + */ |
36 | 40 | function formatMetadata( $image ) { |
37 | 41 | $meta = $image->getMetadata(); |
38 | 42 | |