r110518 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110517‎ | r110518 | r110519 >
Date:20:53, 1 February 2012
Author:hashar
Status:ok
Tags:core 
Comment:
Fix doxygen docs before REL1_19 branching
Modified paths:
  • /trunk/phase3/includes/CategoryViewer.php (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/Html.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/MagicWord.php (modified) (history)
  • /trunk/phase3/includes/PHPVersionError.php (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/includes/WebResponse.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)
  • /trunk/phase3/includes/actions/CreditsAction.php (modified) (history)
  • /trunk/phase3/includes/actions/WatchAction.php (modified) (history)
  • /trunk/phase3/includes/conf/Conf.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalRepo.php (modified) (history)
  • /trunk/phase3/includes/installer/PhpBugTests.php (modified) (history)
  • /trunk/phase3/includes/logging/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/media/BitmapMetadataHandler.php (modified) (history)
  • /trunk/phase3/includes/media/DjVu.php (modified) (history)
  • /trunk/phase3/includes/media/Exif.php (modified) (history)
  • /trunk/phase3/includes/media/FormatMetadata.php (modified) (history)
  • /trunk/phase3/includes/media/Generic.php (modified) (history)
  • /trunk/phase3/includes/media/XMP.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserCache.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOutput.php (modified) (history)
  • /trunk/phase3/includes/search/SearchMySQL.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListusers.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserrights.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBe.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageBe_tarask.php (modified) (history)
  • /trunk/phase3/maintenance/nextJobDB.php (modified) (history)
  • /trunk/phase3/maintenance/parse.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/TitleTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/api/ApiTestCase.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/specials/SpecialSearchTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/languages/LanguageTrTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parse.php
@@ -88,7 +88,7 @@
8989 }
9090
9191 /**
92 - * @param string $text Wikitext to parse
 92+ * @param string $wikitext Wikitext to parse
9393 * @return ParserOutput
9494 */
9595 protected function parse( $wikitext ) {
Index: trunk/phase3/maintenance/nextJobDB.php
@@ -106,7 +106,6 @@
107107
108108 /**
109109 * Get all databases that have a pending job
110 - * @param $type String Job type
111110 * @return array
112111 */
113112 private function getPendingDbs() {
Index: trunk/phase3/tests/phpunit/includes/TitleTest.php
@@ -44,7 +44,7 @@
4545 * @group Database
4646 * @param string $source
4747 * @param string $target
48 - * @param array|string|true $requiredErrors
 48+ * @param array|string|true $expected Required error
4949 * @dataProvider dataTestIsValidMoveOperation
5050 */
5151 function testIsValidMoveOperation( $source, $target, $expected ) {
Index: trunk/phase3/tests/phpunit/includes/specials/SpecialSearchTest.php
@@ -18,10 +18,12 @@
1919 * @dataProvider provideSearchOptionsTests
2020 * @param $requested Array Request parameters. For example array( 'ns5' => true, 'ns6' => true). NULL to use default options.
2121 * @param $userOptions Array User options to test with. For example array('searchNs5' => 1 );. NULL to use default options.
 22+ * @param $expectedProfile An expected search profile name
 23+ * @param $expectedNs Array Expected namespaces
2224 */
2325 function testProfileAndNamespaceLoading(
2426 $requested, $userOptions, $expectedProfile, $expectedNS,
25 - $message = 'Profile name andnamespaces mismatches!'
 27+ $message = 'Profile name and namespaces mismatches!'
2628 ) {
2729 $context = new RequestContext;
2830 $context->setUser(
Index: trunk/phase3/tests/phpunit/includes/api/ApiTestCase.php
@@ -70,6 +70,7 @@
7171 * request, without actually requesting a "real" edit token
7272 * @param $params: key-value API params
7373 * @param $session: session array
 74+ * @param $user String|null A User object for the context
7475 */
7576 protected function doApiRequestWithToken( $params, $session, $user = null ) {
7677 if ( $session['wsToken'] ) {
Index: trunk/phase3/tests/phpunit/languages/LanguageTrTest.php
@@ -18,7 +18,10 @@
1919
2020 /**
2121 * See @bug 28040
22 - * Credits to #wikipedia-tr users berm, []LuCkY[] and Emperyan
 22+ * Credits to irc://irc.freenode.net/wikipedia-tr users:
 23+ * - berm
 24+ * - []LuCkY[]
 25+ * - Emperyan
2326 * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I
2427 * @dataProvider provideDottedAndDotlessI
2528 */
Index: trunk/phase3/includes/search/SearchMySQL.php
@@ -45,7 +45,7 @@
4646 * become part of a WHERE clause
4747 *
4848 * @param $filteredText string
49 - * @param $fullText string
 49+ * @param $fulltext string
5050 *
5151 * @return string
5252 */
@@ -290,6 +290,7 @@
291291 /**
292292 * Get the base part of the search query.
293293 *
 294+ * @param &$query Search query array
294295 * @param $filteredTerm String
295296 * @param $fulltext Boolean
296297 * @since 1.18 (changed)
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -562,7 +562,11 @@
563563 * to the link cache, so the local cache here should be unnecessary, but
564564 * in fact calling getLength() repeatedly for the same $page does seem to
565565 * run one query for each call?
 566+ * @todo Document parameters
 567+ *
566568 * @param $parser Parser
 569+ * @param $page String TODO DOCUMENT (Default: empty string)
 570+ * @param $raw TODO DOCUMENT (Default: null)
567571 */
568572 static function pagesize( $parser, $page = '', $raw = null ) {
569573 static $cache = array();
Index: trunk/phase3/includes/parser/ParserOutput.php
@@ -285,7 +285,7 @@
286286 * Register a file dependency for this output
287287 * @param $name string Title dbKey
288288 * @param $timestamp string MW timestamp of file creation (or false if non-existing)
289 - * @param $sha string base 36 SHA-1 of file (or false if non-existing)
 289+ * @param $sha1 string base 36 SHA-1 of file (or false if non-existing)
290290 * @return void
291291 */
292292 function addImage( $name, $timestamp = null, $sha1 = null ) {
Index: trunk/phase3/includes/parser/ParserCache.php
@@ -100,6 +100,8 @@
101101 * It would be preferable to have this code in get()
102102 * instead of having Article looking in our internals.
103103 *
 104+ * @todo Document parameter $useOutdated
 105+ *
104106 * @param $article Article
105107 * @param $popts ParserOptions
106108 */
Index: trunk/phase3/includes/Linker.php
@@ -241,6 +241,8 @@
242242 * Returns the Url used to link to a Title
243243 *
244244 * @param $target Title
 245+ * @param $query Array: query parameters
 246+ * @param $options Array
245247 */
246248 private static function linkUrl( $target, $query, $options ) {
247249 wfProfileIn( __METHOD__ );
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php
@@ -893,7 +893,7 @@
894894 * Handle reserved keyword replacement in table names
895895 *
896896 * @param $name Object
897 - * @param $name Boolean
 897+ * @param $format String Ignored parameter Default 'quoted'Boolean
898898 * @return String
899899 */
900900 public function tableName( $name, $format = 'quoted' ) {
Index: trunk/phase3/includes/db/Database.php
@@ -1432,7 +1432,7 @@
14331433 *
14341434 * @param $table string|array Table name
14351435 * @param $vars string|array Field names
1436 - * @param $conds|array Conditions
 1436+ * @param $conds array Conditions
14371437 * @param $fname string Caller function name
14381438 * @param $options string|array Query options
14391439 * @param $join_conds array|string Join conditions
Index: trunk/phase3/includes/conf/Conf.php
@@ -25,7 +25,6 @@
2626 *
2727 * @file
2828 * @defgroup Config Config
29 - * @ingroup Config
3029 */
3130 abstract class Conf {
3231 /**
Index: trunk/phase3/includes/UserMailer.php
@@ -109,8 +109,8 @@
110110 /**
111111 * Creates a single string from an associative array
112112 *
113 - * @param $header Associative Array: keys are header field names,
114 - * values are ... values.
 113+ * @param $headers Associative Array: keys are header field names,
 114+ * values are ... values.
115115 * @param $endl String: The end of line character. Defaults to "\n"
116116 * @return String
117117 */
Index: trunk/phase3/includes/filerepo/LocalRepo.php
@@ -208,10 +208,10 @@
209209 }
210210
211211 /**
212 - * Get an array or iterator of file objects for files that have a given
 212+ * Get an array or iterator of file objects for files that have a given
213213 * SHA-1 content hash.
214214 *
215 - * @param string
 215+ * @param $hash String a sha1 hash to look for
216216 * @return Array
217217 */
218218 function findBySha1( $hash ) {
Index: trunk/phase3/includes/CategoryViewer.php
@@ -12,7 +12,7 @@
1313 $imgsNoGallery;
1414
1515 /**
16 - * @var
 16+ * @var Array
1717 */
1818 var $nextPage;
1919
Index: trunk/phase3/includes/logging/LogEventsList.php
@@ -230,7 +230,6 @@
231231
232232 /**
233233 * Returns log page selector.
234 - * @param $default string The default selection
235234 * @return XmlSelect
236235 * @since 1.19
237236 */
Index: trunk/phase3/includes/Html.php
@@ -376,20 +376,22 @@
377377 * and converted to a space-separated string. In addition to a numerical
378378 * array, the attribute value may also be an associative array. See the
379379 * example below for how that works.
380 - * @example Numerical array
381 - * <code>
 380+ *
 381+ * @par Numerical array
 382+ * @code
382383 * Html::element( 'em', array(
383384 * 'class' => array( 'foo', 'bar' )
384385 * ) );
385386 * // gives '<em class="foo bar"></em>'
386 - * </code>
387 - * @example Associative array
388 - * <code>
 387+ * @endcode
 388+ *
 389+ * @par Associative array
 390+ * @code
389391 * Html::element( 'em', array(
390392 * 'class' => array( 'foo', 'bar', 'foo' => false, 'quux' => true )
391393 * ) );
392394 * // gives '<em class="bar quux"></em>'
393 - * </code>
 395+ * @endcode
394396 *
395397 * @param $attribs array Associative array of attributes, e.g., array(
396398 * 'href' => 'http://www.mediawiki.org/' ). Values will be HTML-escaped.
Index: trunk/phase3/includes/installer/PhpBugTests.php
@@ -18,8 +18,7 @@
1919 * http://www.gnu.org/copyleft/gpl.html
2020 *
2121 * @file
22 - * @defgroup PHPBugTests
23 - * @ingroup PHPBugTests
 22+ * @defgroup PHPBugTests PHP known bugs tests
2423 */
2524
2625 /**
Index: trunk/phase3/includes/actions/CreditsAction.php
@@ -219,8 +219,7 @@
220220
221221 /**
222222 * Get a link to action=credits of $article page
223 - * @param $article Article object
224 - * @return String: html
 223+ * @return String: HTML link
225224 */
226225 protected function othersLink() {
227226 return Linker::linkKnown(
Index: trunk/phase3/includes/actions/WatchAction.php
@@ -106,7 +106,7 @@
107107 * Get token to watch (or unwatch) a page for a user
108108 *
109109 * @param Title $title Title object of page to watch
110 - * @param User $title User for whom the action is going to be performed
 110+ * @param User $user User for whom the action is going to be performed
111111 * @param string $action Optionally override the action to 'unwatch'
112112 * @return string Token
113113 * @since 1.18
@@ -126,7 +126,7 @@
127127 * Get token to unwatch (or watch) a page for a user
128128 *
129129 * @param Title $title Title object of page to unwatch
130 - * @param User $title User for whom the action is going to be performed
 130+ * @param User $user User for whom the action is going to be performed
131131 * @param string $action Optionally override the action to 'watch'
132132 * @return string Token
133133 * @since 1.18
Index: trunk/phase3/includes/media/FormatMetadata.php
@@ -1183,7 +1183,7 @@
11841184 * Format a coordinate value, convert numbers from floating point
11851185 * into degree minute second representation.
11861186 *
1187 - * @param $coords Array: degrees, minutes and seconds
 1187+ * @param $coord Array: degrees, minutes and seconds
11881188 * @param $type String: latitude or longitude (for if its a NWS or E)
11891189 * @return mixed A floating point number or whatever we were fed
11901190 */
Index: trunk/phase3/includes/media/Exif.php
@@ -101,6 +101,7 @@
102102 * Constructor
103103 *
104104 * @param $file String: filename.
 105+ * @param $byteOrder String Type of byte ordering either 'BE' (Big Endian) or 'LE' (Little Endian). Default ''.
105106 * @todo FIXME: The following are broke:
106107 * SubjectArea. Need to test the more obscure tags.
107108 *
Index: trunk/phase3/includes/media/XMP.php
@@ -210,9 +210,9 @@
211211 * Also catches any errors during processing, writes them to
212212 * debug log, blanks result array and returns false.
213213 *
214 - * @param String: $content XMP data
215 - * @param Boolean: $allOfIt If this is all the data (true) or if its split up (false). Default true
216 - * @param Boolean: $reset - does xml parser need to be reset. Default false
 214+ * @param $content String: XMP data
 215+ * @param $allOfIt Boolean: If this is all the data (true) or if its split up (false). Default true
 216+ * @param $reset Boolean: does xml parser need to be reset. Default false
217217 * @return Boolean success.
218218 */
219219 public function parse( $content, $allOfIt = true, $reset = false ) {
Index: trunk/phase3/includes/media/DjVu.php
@@ -190,6 +190,7 @@
191191 /**
192192 * Cache a document tree for the DjVu XML metadata
193193 * @param $image File
 194+ * @param $gettext Boolean: DOCUMENT (Default: false)
194195 */
195196 function getMetaTree( $image , $gettext = false ) {
196197 if ( isset( $image->dejaMetaTree ) ) {
Index: trunk/phase3/includes/media/BitmapMetadataHandler.php
@@ -52,7 +52,10 @@
5353 * Basically what used to be in BitmapHandler::getMetadata().
5454 * Just calls stuff in the Exif class.
5555 *
 56+ * Parameters are passed to the Exif class.
 57+ *
5658 * @param $filename string
 59+ * @param $byteOrder string
5760 */
5861 function getExif ( $filename, $byteOrder ) {
5962 global $wgShowEXIF;
Index: trunk/phase3/includes/media/Generic.php
@@ -364,7 +364,7 @@
365365 * @param &$array Array An array containing elements for each type of visibility
366366 * and each of those elements being an array of metadata items. This function adds
367367 * a value to that array.
368 - * @param $visbility string ('visible' or 'collapsed') if this value is hidden
 368+ * @param $visibility string ('visible' or 'collapsed') if this value is hidden
369369 * by default.
370370 * @param $type String type of metadata tag (currently always 'exif')
371371 * @param $id String the name of the metadata tag (like 'artist' for example).
Index: trunk/phase3/includes/ChangesList.php
@@ -344,9 +344,11 @@
345345 $this->getLanguage()->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
346346 }
347347
348 - /** Insert links to user page, user talk page and eventually a blocking link
 348+ /**
 349+ * Insert links to user page, user talk page and eventually a blocking link
349350 *
350 - * @param $rc RecentChange
 351+ * @param &$s String HTML to update
 352+ * @param &$rc RecentChange
351353 */
352354 public function insertUserRelatedLinks( &$s, &$rc ) {
353355 if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
@@ -359,7 +361,7 @@
360362 }
361363
362364 /**
363 - * insert a formatted action
 365+ * Insert a formatted action
364366 *
365367 * @param $rc RecentChange
366368 */
Index: trunk/phase3/includes/MagicWord.php
@@ -10,9 +10,14 @@
1111
1212 /**
1313 * This class encapsulates "magic words" such as #redirect, __NOTOC__, etc.
14 - * Usage:
15 - * if (MagicWord::get( 'redirect' )->match( $text ) )
1614 *
 15+ * @par Usage:
 16+ * @code
 17+ * if (MagicWord::get( 'redirect' )->match( $text ) ) {
 18+ * // some code
 19+ * }
 20+ * @endcode
 21+ *
1722 * Possible future improvements:
1823 * * Simultaneous searching for a number of magic words
1924 * * MagicWord::$mObjects in shared memory
@@ -23,14 +28,15 @@
2429 * To add magic words in an extension, use $magicWords in a file listed in
2530 * $wgExtensionMessagesFiles[].
2631 *
27 - * Example:
28 - *
 32+ * @par Example:
 33+ * @code
2934 * $magicWords = array();
3035 *
3136 * $magicWords['en'] = array(
3237 * 'magicwordkey' => array( 0, 'case_insensitive_magic_word' ),
3338 * 'magicwordkey2' => array( 1, 'CASE_sensitive_magic_word2' ),
3439 * );
 40+ * @endcode
3541 *
3642 * For magic words which are also Parser variables, add a MagicWordwgVariableIDs
3743 * hook. Use string keys.
Index: trunk/phase3/includes/WikiPage.php
@@ -1900,7 +1900,7 @@
19011901 * Revision::DELETED_RESTRICTED
19021902 * @param $id int article ID
19031903 * @param $commit boolean defaults to true, triggers transaction end
1904 - * @param &$errors Array of errors to append to
 1904+ * @param &$error Array of errors to append to
19051905 * @param $user User The relevant user
19061906 * @return boolean true if successful
19071907 */
Index: trunk/phase3/includes/specials/SpecialUserrights.php
@@ -493,7 +493,9 @@
494494 /**
495495 * Adds a table with checkboxes where you can select what groups to add/remove
496496 *
 497+ * @todo Just pass the username string?
497498 * @param $usergroups Array: groups the user belongs to
 499+ * @param $user User a user object
498500 * @return string XHTML table element with checkboxes
499501 */
500502 private function groupCheckboxes( $usergroups, $user ) {
Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -1263,6 +1263,8 @@
12641264 * Fetch revision text link if it's available to all users
12651265 *
12661266 * @param $rev Revision
 1267+ * @param $titleObj Title
 1268+ * @param $ts Timestamp
12671269 * @return string
12681270 */
12691271 function getPageLink( $rev, $titleObj, $ts ) {
@@ -1292,6 +1294,10 @@
12931295 * Fetch image view link if it's available to all users
12941296 *
12951297 * @param $file File
 1298+ * @param $titleObj Title
 1299+ * @param $ts A timestamp
 1300+ * @param $key String: a storage key
 1301+ *
12961302 * @return String: HTML fragment
12971303 */
12981304 function getFileLink( $file, $titleObj, $ts, $key ) {
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -72,8 +72,6 @@
7373
7474 /**
7575 * Loader
76 - *
77 - * @param $request WebRequest object
7876 */
7977 function load() {
8078 global $wgAuth, $wgHiddenPrefs, $wgEnableEmail, $wgRedirectOnLogin;
Index: trunk/phase3/includes/specials/SpecialListusers.php
@@ -263,6 +263,7 @@
264264 * Format a link to a group description page
265265 *
266266 * @param $group String: group name
 267+ * @param $username String Username
267268 * @return string
268269 */
269270 protected static function buildGroupLink( $group, $username ) {
Index: trunk/phase3/includes/PHPVersionError.php
@@ -7,7 +7,7 @@
88 *
99 * Calling this function kills execution immediately.
1010 *
11 - * @param $entryPoint String Which entry point we're protecting. One of:
 11+ * @param $type String Which entry point we are protecting. One of:
1212 * - index.php
1313 * - load.php
1414 * - api.php
@@ -88,4 +88,4 @@
8989 }
9090 echo( "$finalOutput\n" );
9191 die( 1 );
92 -}
\ No newline at end of file
 92+}
Index: trunk/phase3/includes/WebResponse.php
@@ -131,9 +131,14 @@
132132 }
133133
134134 /**
 135+ * @todo document. It just ignore optional parameters.
 136+ *
135137 * @param $name String: name of cookie
136138 * @param $value String: value to give cookie
137 - * @param $expire Int: number of seconds til cookie expires
 139+ * @param $expire Int: number of seconds til cookie expires (Default: 0)
 140+ * @param $prefix TODO DOCUMENT (Default: null)
 141+ * @param $domain TODO DOCUMENT (Default: null)
 142+ *
138143 */
139144 public function setcookie( $name, $value, $expire = 0, $prefix = null, $domain = null ) {
140145 $this->cookies[$name] = $value;
Index: trunk/phase3/languages/Language.php
@@ -1261,7 +1261,7 @@
12621262 *
12631263 * Based on a PHP-Nuke block by Sharjeel which is released under GNU/GPL license
12641264 *
1265 - * @link http://phpnuke.org/modules.php?name=News&file=article&sid=8234&mode=thread&order=0&thold=0
 1265+ * @see http://phpnuke.org/modules.php?name=News&file=article&sid=8234&mode=thread&order=0&thold=0
12661266 *
12671267 * @param $ts string
12681268 *
Index: trunk/phase3/languages/classes/LanguageBe.php
@@ -7,7 +7,7 @@
88 * @ingroup Language
99 *
1010 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
11 - * @link http://be.wikipedia.org/wiki/Talk:LanguageBe.php
 11+ * @see http://be.wikipedia.org/wiki/Talk:LanguageBe.php
1212 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
1313 * @license http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License
1414 */
Index: trunk/phase3/languages/classes/LanguageBe_tarask.php
@@ -4,7 +4,7 @@
55 * @ingroup Language
66 *
77 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
8 - * @link http://be-x-old.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php
 8+ * @see http://be-x-old.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php
99 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
1010 * @license http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License
1111 */

Status & tagging log