From: jenkins-bot Date: Wed, 23 Apr 2014 13:49:38 +0000 (+0000) Subject: Merge "Make users API cache mode public if blockinfo is not queried" X-Git-Tag: 1.31.0-rc.0~16061 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=5775d5e5c15098da4c1ebc121e678cee95ecaafa;hp=34bd462a778db82dc17ae9642f16f463d2165b80;p=lhc%2Fweb%2Fwiklou.git Merge "Make users API cache mode public if blockinfo is not queried" --- diff --git a/docs/kss/README.txt b/docs/kss/README.txt index d91bf2aa6c..f9473b8782 100644 --- a/docs/kss/README.txt +++ b/docs/kss/README.txt @@ -2,3 +2,17 @@ The Makefile, package.json, scripts, styleguide-template, and mediawiki.ui/styleguide.md files and directories in here support the automatic generation of CSS documentation from the source LESS files using kss for node.js, https://github.com/kneath/kss + +To build and open in your web browser, run: + +MEDIAWIKI_LOAD_URL=mediawiki_hostname/w/load.php make kssopen + +For example, + +MEDIAWIKI_LOAD_URL=1.2.3.4/w/load.php make kssopen + +If MediaWiki is running on localhost, you can omit MEDIAWIKI_LOAD_URL. + +To rebuild without opening the web browser, run: + +MEDIAWIKI_LOAD_URL=mediawiki_hostname/w/load.php make diff --git a/img_auth.php b/img_auth.php index dc3dcd8f6d..a3485dfd7e 100644 --- a/img_auth.php +++ b/img_auth.php @@ -12,8 +12,6 @@ * - Set $wgImgAuthDetails = true if you want the reason the access was denied messages to * be displayed instead of just the 403 error (doesn't work on IE anyway), * otherwise it will only appear in error logs - * - Set $wgImgAuthPublicTest false if you don't want to just check and see if all are public - * must be set to false if using specific restrictions such as LockDown or NSFileRepo * * For security reasons, you usually don't want your user to know *why* access was denied, * just that it was. If you want to change this, you can set $wgImgAuthDetails to 'true' @@ -50,20 +48,17 @@ $wgActionPaths = array( "$wgUploadPath/" ); wfImageAuthMain(); wfLogProfilingData(); +// Commit and close up! +$factory = wfGetLBFactory(); +$factory->commitMasterChanges(); +$factory->shutdown(); function wfImageAuthMain() { - global $wgImgAuthPublicTest, $wgImgAuthUrlPathMap; + global $wgImgAuthUrlPathMap; $request = RequestContext::getMain()->getRequest(); $publicWiki = in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ); - // See if this is a public Wiki (no protections). - if ( $wgImgAuthPublicTest && $publicWiki ) { - // This is a public wiki, so disable this script (for private wikis only) - wfForbidden( 'img-auth-accessdenied', 'img-auth-public' ); - return; - } - // Get the requested file path (source file or thumbnail) $matches = WebRequest::getPathInfo(); if ( !isset( $matches['title'] ) ) { @@ -78,7 +73,7 @@ function wfImageAuthMain() { // Check for bug 28235: QUERY_STRING overriding the correct extension $whitelist = array(); - $extension = FileBackend::extensionFromPath( $path ); + $extension = FileBackend::extensionFromPath( $path, 'rawcase' ); if ( $extension != '' ) { $whitelist[] = $extension; } diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index 4b5ca75eb0..a3808a5496 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -48,7 +48,7 @@ class AjaxResponse { /** * Date for the HTTP header Last-modified - * @var string|false $mLastModified + * @var string|bool $mLastModified */ private $mLastModified; @@ -71,7 +71,7 @@ class AjaxResponse { private $mText; /** - * @param $text string|null + * @param string|null $text */ function __construct( $text = null ) { $this->mCacheDuration = null; @@ -90,7 +90,7 @@ class AjaxResponse { /** * Set the number of seconds to get the response cached by a proxy - * @param $duration int + * @param int $duration */ function setCacheDuration( $duration ) { $this->mCacheDuration = $duration; @@ -98,7 +98,7 @@ class AjaxResponse { /** * Set the HTTP Vary header - * @param $vary string + * @param string $vary */ function setVary( $vary ) { $this->mVary = $vary; @@ -106,7 +106,7 @@ class AjaxResponse { /** * Set the HTTP response code - * @param $code string + * @param string $code */ function setResponseCode( $code ) { $this->mResponseCode = $code; @@ -114,7 +114,7 @@ class AjaxResponse { /** * Set the HTTP header Content-Type - * @param $type string + * @param string $type */ function setContentType( $type ) { $this->mContentType = $type; @@ -129,7 +129,7 @@ class AjaxResponse { /** * Add content to the response - * @param $text string + * @param string $text */ function addText( $text ) { if ( ! $this->mDisabled && $text ) { @@ -206,7 +206,7 @@ class AjaxResponse { * possible. If successful, the AjaxResponse is disabled so that * any future call to AjaxResponse::printText() have no effect. * - * @param $timestamp string + * @param string $timestamp * @return bool Returns true if the response code was set to 304 Not Modified. */ function checkLastModified( $timestamp ) { @@ -262,8 +262,8 @@ class AjaxResponse { } /** - * @param $mckey string - * @param $touched int + * @param string $mckey + * @param int $touched * @return bool */ function loadFromMemcached( $mckey, $touched ) { @@ -290,8 +290,8 @@ class AjaxResponse { } /** - * @param $mckey string - * @param $expiry int + * @param string $mckey + * @param int $expiry * @return bool */ function storeInMemcached( $mckey, $expiry = 86400 ) { diff --git a/includes/Article.php b/includes/Article.php index 5ebeb6072d..e73fe9d640 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -90,7 +90,7 @@ class Article implements Page { /** * URL to redirect to or false if none - * @var string|false $mRedirectUrl + * @var string|bool $mRedirectUrl */ var $mRedirectUrl = false; // !< @@ -116,8 +116,8 @@ class Article implements Page { /** * Constructor and clear the article - * @param $title Title Reference to a Title object. - * @param $oldId Integer revision ID, null to fetch from request, zero for current + * @param Title $title Reference to a Title object. + * @param int $oldId Revision ID, null to fetch from request, zero for current */ public function __construct( Title $title, $oldId = null ) { $this->mOldId = $oldId; @@ -125,7 +125,7 @@ class Article implements Page { } /** - * @param $title Title + * @param Title $title * @return WikiPage */ protected function newPage( Title $title ) { @@ -134,7 +134,7 @@ class Article implements Page { /** * Constructor from a page id - * @param int $id article ID to load + * @param int $id Article ID to load * @return Article|null */ public static function newFromID( $id ) { @@ -147,9 +147,9 @@ class Article implements Page { /** * Create an Article object of the appropriate class for the given page. * - * @param $title Title - * @param $context IContextSource - * @return Article object + * @param Title $title + * @param IContextSource $context + * @return Article */ public static function newFromTitle( $title, IContextSource $context ) { if ( NS_MEDIA == $title->getNamespace() ) { @@ -179,9 +179,9 @@ class Article implements Page { /** * Create an Article object of the appropriate class for the given page. * - * @param $page WikiPage - * @param $context IContextSource - * @return Article object + * @param WikiPage $page + * @param IContextSource $context + * @return Article */ public static function newFromWikiPage( WikiPage $page, IContextSource $context ) { $article = self::newFromTitle( $page->getTitle(), $context ); @@ -192,7 +192,7 @@ class Article implements Page { /** * Tell the page view functions that this view was redirected * from another page on the wiki. - * @param $from Title object. + * @param Title $from */ public function setRedirectedFrom( Title $from ) { $this->mRedirectedFrom = $from; @@ -201,7 +201,7 @@ class Article implements Page { /** * Get the title object of the article * - * @return Title object of this page + * @return Title Title object of this page */ public function getTitle() { return $this->mPage->getTitle(); @@ -290,8 +290,7 @@ class Article implements Page { } /** - * @return int The oldid of the article that is to be shown, 0 for the - * current revision + * @return int The oldid of the article that is to be shown, 0 for the current revision */ public function getOldID() { if ( is_null( $this->mOldId ) ) { @@ -373,7 +372,7 @@ class Article implements Page { * uses this method to retrieve page text from the database, so the function * has to remain public for now. * - * @return mixed string containing article contents, or false if null + * @return string|bool String containing article contents, or false if null * @deprecated since 1.21, use WikiPage::getContent() instead */ function fetchContent() { #BC cruft! @@ -404,7 +403,7 @@ class Article implements Page { * @note Code that wants to retrieve page content from the database should * use WikiPage::getContent(). * - * @return Content|null|boolean false + * @return Content|null|bool * * @since 1.21 */ @@ -499,7 +498,7 @@ class Article implements Page { /** * Use this to fetch the rev ID used on page views * - * @return int revision ID of last article revision + * @return int Revision ID of last article revision */ public function getRevIdFetched() { if ( $this->mRevIdFetched ) { @@ -769,7 +768,7 @@ class Article implements Page { /** * Adjust title for pages with displaytitle, -{T|}- or language conversion - * @param $pOutput ParserOutput + * @param ParserOutput $pOutput */ public function adjustDisplayTitle( ParserOutput $pOutput ) { # Adjust the title if it was set by displaytitle, -{T|}- or language conversion @@ -831,7 +830,7 @@ class Article implements Page { * This is hooked by SyntaxHighlight_GeSHi to do syntax highlighting of these * page views. * - * @param bool $showCacheHint whether to show a message telling the user + * @param bool $showCacheHint Whether to show a message telling the user * to clear the browser cache (default: true). */ protected function showCssOrJsPage( $showCacheHint = true ) { @@ -863,10 +862,10 @@ class Article implements Page { /** * Get the robot policy to be used for the current view - * @param string $action the action= GET parameter - * @param $pOutput ParserOutput|null - * @return Array the policy that should be set - * TODO: actions other than 'view' + * @param string $action The action= GET parameter + * @param ParserOutput|null $pOutput + * @return array The policy that should be set + * @todo: actions other than 'view' */ public function getRobotPolicy( $action, $pOutput = null ) { global $wgArticleRobotPolicies, $wgNamespaceRobotPolicies, $wgDefaultRobotPolicy; @@ -944,9 +943,9 @@ class Article implements Page { /** * Converts a String robot policy into an associative array, to allow * merging of several policies using array_merge(). - * @param $policy Mixed, returns empty array on null/false/'', transparent - * to already-converted arrays, converts String. - * @return Array: 'index' => \, 'follow' => \ + * @param array|string $policy Returns empty array on null/false/'', transparent + * to already-converted arrays, converts string. + * @return array 'index' => \, 'follow' => \ */ public static function formatRobotPolicy( $policy ) { if ( is_array( $policy ) ) { @@ -975,7 +974,7 @@ class Article implements Page { * the output. Returns true if the header was needed, false if this is not * a redirect view. Handles both local and remote redirects. * - * @return boolean + * @return bool */ public function showRedirectedFromHeader() { global $wgRedirectSources; @@ -1277,7 +1276,7 @@ class Article implements Page { * If the revision requested for view is deleted, check permissions. * Send either an error message or a warning header to the output. * - * @return boolean true if the view is allowed, false if not. + * @return bool true if the view is allowed, false if not. */ public function showDeletedRevisionHeader() { if ( !$this->mRevision->isDeleted( Revision::DELETED_TEXT ) ) { @@ -1320,7 +1319,7 @@ class Article implements Page { * Revision as of \; view current revision * \<- Previous version | Next Version -\> * - * @param int $oldid revision ID of this article revision + * @param int $oldid Revision ID of this article revision */ public function setOldSubtitle( $oldid = 0 ) { if ( !wfRunHooks( 'DisplayOldSubtitle', array( &$this, &$oldid ) ) ) { @@ -1445,10 +1444,10 @@ class Article implements Page { * Chances are you should just be using the ParserOutput from * WikitextContent::getParserOutput instead of calling this for redirects. * - * @param $target Title|Array of destination(s) to redirect - * @param $appendSubtitle Boolean [optional] - * @param $forceKnown Boolean: should the image be shown as a bluelink regardless of existence? - * @return string containing HMTL with redirect link + * @param Title|array $target Destination(s) to redirect + * @param bool $appendSubtitle [optional] + * @param bool $forceKnown Should the image be shown as a bluelink regardless of existence? + * @return string Containing HMTL with redirect link */ public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) { $lang = $this->getTitle()->getPageLanguage(); @@ -1467,9 +1466,9 @@ class Article implements Page { * * @since 1.23 * @param Language $lang - * @param Title|array $target destination(s) to redirect + * @param Title|array $target Destination(s) to redirect * @param bool $forceKnown Should the image be shown as a bluelink regardless of existence? - * @return string containing HMTL with redirect link + * @return string Containing HMTL with redirect link */ public static function getRedirectHeaderHtml( Language $lang, $target, $forceKnown = false ) { global $wgStylePath; @@ -1658,7 +1657,7 @@ class Article implements Page { /** * Output deletion confirmation dialog * @todo FIXME: Move to another file? - * @param string $reason prefilled reason + * @param string $reason Prefilled reason */ public function confirmDelete( $reason ) { wfDebug( "Article::confirmDelete\n" ); @@ -1826,7 +1825,7 @@ class Article implements Page { * output to the client that is necessary for this request. * (that is, it has sent a cached version of the page) * - * @return boolean true if cached version send, false otherwise + * @return bool true if cached version send, false otherwise */ protected function tryFileCache() { static $called = false; @@ -1882,9 +1881,9 @@ class Article implements Page { * * @since 1.16 (r52326) for LiquidThreads * - * @param $oldid mixed integer Revision ID or null - * @param $user User The relevant user - * @return ParserOutput or false if the given revision ID is not found + * @param int|null $oldid Revision ID or null + * @param User $user The relevant user + * @return ParserOutput|bool ParserOutput or false if the given revision ID is not found */ public function getParserOutput( $oldid = null, User $user = null ) { //XXX: bypasses mParserOptions and thus setParserOptions() @@ -1928,7 +1927,7 @@ class Article implements Page { /** * Sets the context this Article is executed in * - * @param $context IContextSource + * @param IContextSource $context * @since 1.18 */ public function setContext( $context ) { @@ -2006,7 +2005,7 @@ class Article implements Page { * raw WikiPage fields for backwards compatibility. * * @param string $fname Field name - * @param $fvalue mixed New value + * @param mixed $fvalue New value */ public function __set( $fname, $fvalue ) { if ( property_exists( $this->mPage, $fname ) ) { @@ -2039,11 +2038,11 @@ class Article implements Page { // ****** B/C functions to work-around PHP silliness with __call and references ****** // /** - * @param $limit array - * @param $expiry array - * @param $cascade bool - * @param $reason string - * @param $user User + * @param array $limit + * @param array $expiry + * @param bool $cascade + * @param string $reason + * @param User $user * @return Status */ public function doUpdateRestrictions( array $limit, array $expiry, &$cascade, @@ -2053,10 +2052,10 @@ class Article implements Page { } /** - * @param $limit array - * @param $reason string - * @param $cascade int - * @param $expiry array + * @param array $limit + * @param string $reason + * @param int $cascade + * @param array $expiry * @return bool */ public function updateRestrictions( $limit = array(), $reason = '', @@ -2072,11 +2071,11 @@ class Article implements Page { } /** - * @param $reason string - * @param $suppress bool - * @param $id int - * @param $commit bool - * @param $error string + * @param string $reason + * @param bool $suppress + * @param int $id + * @param bool $commit + * @param string $error * @return bool */ public function doDeleteArticle( $reason, $suppress = false, $id = 0, @@ -2086,12 +2085,12 @@ class Article implements Page { } /** - * @param $fromP - * @param $summary - * @param $token - * @param $bot - * @param $resultDetails - * @param $user User + * @param string $fromP + * @param string $summary + * @param string $token + * @param bool $bot + * @param array $resultDetails + * @param User|null $user * @return array */ public function doRollback( $fromP, $summary, $token, $bot, &$resultDetails, User $user = null ) { @@ -2100,11 +2099,11 @@ class Article implements Page { } /** - * @param $fromP - * @param $summary - * @param $bot - * @param $resultDetails - * @param $guser User + * @param string $fromP + * @param string $summary + * @param bool $bot + * @param array $resultDetails + * @param User|null $guser * @return array */ public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser = null ) { @@ -2113,7 +2112,7 @@ class Article implements Page { } /** - * @param $hasHistory bool + * @param bool $hasHistory * @return mixed */ public function generateReason( &$hasHistory ) { @@ -2132,30 +2131,30 @@ class Article implements Page { } /** - * @param $title Title + * @param Title $title */ public static function onArticleCreate( $title ) { WikiPage::onArticleCreate( $title ); } /** - * @param $title Title + * @param Title $title */ public static function onArticleDelete( $title ) { WikiPage::onArticleDelete( $title ); } /** - * @param $title Title + * @param Title $title */ public static function onArticleEdit( $title ) { WikiPage::onArticleEdit( $title ); } /** - * @param $oldtext - * @param $newtext - * @param $flags + * @param string $oldtext + * @param string $newtext + * @param int $flags * @return string * @deprecated since 1.21, use ContentHandler::getAutosummary() instead */ diff --git a/includes/AuthPlugin.php b/includes/AuthPlugin.php index 217744e47e..45ad4d1bd1 100644 --- a/includes/AuthPlugin.php +++ b/includes/AuthPlugin.php @@ -204,8 +204,8 @@ class AuthPlugin { * Update user information in the external authentication database. * Return true if successful. * - * @param $user User object. - * @return Boolean + * @param User $user + * @return bool */ public function updateExternalDB( $user ) { return true; diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 97a324692a..55457679af 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -887,8 +887,6 @@ $wgAutoloadLocalClasses = array( 'RevisionDeleteUser' => 'includes/revisiondelete/RevisionDeleteUser.php', # includes/search - 'MssqlSearchResultSet' => 'includes/search/SearchMssql.php', - 'MySQLSearchResultSet' => 'includes/search/SearchMySQL.php', 'PostgresSearchResult' => 'includes/search/SearchPostgres.php', 'PostgresSearchResultSet' => 'includes/search/SearchPostgres.php', 'SearchDatabase' => 'includes/search/SearchDatabase.php', @@ -904,7 +902,6 @@ $wgAutoloadLocalClasses = array( 'SearchResultSet' => 'includes/search/SearchResultSet.php', 'SearchResultTooMany' => 'includes/search/SearchEngine.php', 'SearchSqlite' => 'includes/search/SearchSqlite.php', - 'SqliteSearchResultSet' => 'includes/search/SearchSqlite.php', 'SqlSearchResultSet' => 'includes/search/SearchResultSet.php', # includes/site @@ -1123,7 +1120,7 @@ $wgAutoloadLocalClasses = array( # languages 'ConverterRule' => 'languages/ConverterRule.php', - 'FakeConverter' => 'languages/Language.php', + 'FakeConverter' => 'languages/FakeConverter.php', 'Language' => 'languages/Language.php', 'LanguageConverter' => 'languages/LanguageConverter.php', 'CLDRPluralRuleConverter' => 'languages/utils/CLDRPluralRuleConverter.php', @@ -1257,8 +1254,8 @@ class AutoLoader { * Sanitizer that have define()s outside of their class definition. Of course * this wouldn't be necessary if everything in MediaWiki was class-based. Sigh. * - * @param $class string - * @return Boolean Return the results of class_exists() so we know if we were successful + * @param string $class + * @return bool Return the results of class_exists() so we know if we were successful */ static function loadClass( $class ) { return class_exists( $class ); diff --git a/includes/Autopromote.php b/includes/Autopromote.php index 197ad9c957..81f3b7aa00 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -29,7 +29,7 @@ class Autopromote { /** * Get the groups for the given user based on $wgAutopromote. * - * @param $user User The user to get the groups for + * @param User $user The user to get the groups for * @return array Array of groups to promote to. */ public static function getAutopromoteGroups( User $user ) { @@ -53,8 +53,8 @@ class Autopromote { * * Does not return groups the user already belongs to or has once belonged. * - * @param $user User The user to get the groups for - * @param string $event key in $wgAutopromoteOnce (each one has groups/criteria) + * @param User $user The user to get the groups for + * @param string $event Key in $wgAutopromoteOnce (each one has groups/criteria) * * @return array Groups the user should be promoted to. * @@ -99,8 +99,8 @@ class Autopromote { * This function evaluates the former type recursively, and passes off to * self::checkCondition for evaluation of the latter type. * - * @param $cond Mixed: a condition, possibly containing other conditions - * @param $user User The user to check the conditions against + * @param mixed $cond A condition, possibly containing other conditions + * @param User $user The user to check the conditions against * @return bool Whether the condition is true */ private static function recCheckCondition( $cond, User $user ) { @@ -156,7 +156,7 @@ class Autopromote { * APCOND_AGE. Other types will throw an exception if no extension evaluates them. * * @param array $cond A condition, which must not contain other conditions - * @param $user User The user to check the condition against + * @param User $user The user to check the condition against * @throws MWException * @return bool Whether the condition is true for the user */ diff --git a/includes/Block.php b/includes/Block.php index a3d36913a8..d9fa54def0 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -31,22 +31,22 @@ class Block { $mCreateAccount, $mParentBlockId; - /** @var User|String */ + /** @var User|string */ protected $target; - /** @var Integer Hack for foreign blocking (CentralAuth) */ + /** @var int Hack for foreign blocking (CentralAuth) */ protected $forcedTargetID; - /** @var Integer Block::TYPE_ constant. Can only be USER, IP or RANGE internally */ + /** @var int Block::TYPE_ constant. Can only be USER, IP or RANGE internally */ protected $type; /** @var User */ protected $blocker; - /** @var Bool */ + /** @var bool */ protected $isHardblock = true; - /** @var Bool */ + /** @var bool */ protected $isAutoblocking = true; # TYPE constants @@ -104,8 +104,8 @@ class Block { /** * Load a blocked user from their block id. * - * @param $id Integer: Block id to search for - * @return Block object or null + * @param int $id Block id to search for + * @return Block|null */ public static function newFromID( $id ) { $dbr = wfGetDB( DB_SLAVE ); @@ -151,7 +151,7 @@ class Block { * Check if two blocks are effectively equal. Doesn't check irrelevant things like * the blocking user or the block timestamp, only things which affect the blocked user * - * @param $block Block + * @param Block $block * * @return bool */ @@ -176,10 +176,10 @@ class Block { * 1) A block directly on the given user or IP * 2) A rangeblock encompassing the given IP (smallest first) * 3) An autoblock on the given IP - * @param $vagueTarget User|String also search for blocks affecting this target. Doesn't + * @param User|string $vagueTarget Also search for blocks affecting this target. Doesn't * make any sense to use TYPE_AUTO / TYPE_ID here. Leave blank to skip IP lookups. * @throws MWException - * @return Bool whether a relevant block was found + * @return bool Whether a relevant block was found */ protected function newLoad( $vagueTarget = null ) { $db = wfGetDB( $this->mFromMaster ? DB_MASTER : DB_SLAVE ); @@ -280,7 +280,7 @@ class Block { * Get a set of SQL conditions which will select rangeblocks encompassing a given range * @param string $start Hexadecimal IP representation * @param string $end Hexadecimal IP representation, or null to use $start = $end - * @return String + * @return string */ public static function getRangeCond( $start, $end = null ) { if ( $end === null ) { @@ -312,8 +312,8 @@ class Block { /** * Get the component of an IP address which is certain to be the same between an IP * address and a rangeblock containing that IP address. - * @param $hex String Hexadecimal IP representation - * @return String + * @param string $hex Hexadecimal IP representation + * @return string */ protected static function getIpFragment( $hex ) { global $wgBlockCIDRLimit; @@ -327,7 +327,7 @@ class Block { /** * Given a database row from the ipblocks table, initialize * member variables - * @param $row ResultWrapper: a row from the ipblocks table + * @param ResultWrapper $row A row from the ipblocks table */ protected function initFromRow( $row ) { $this->setTarget( $row->ipb_address ); @@ -362,7 +362,7 @@ class Block { /** * Create a new Block object from a database row - * @param $row ResultWrapper row from the ipblocks table + * @param ResultWrapper $row Row from the ipblocks table * @return Block */ public static function newFromRow( $row ) { @@ -375,7 +375,7 @@ class Block { * Delete the row from the IP blocks table. * * @throws MWException - * @return Boolean + * @return bool */ public function delete() { if ( wfReadOnly() ) { @@ -397,8 +397,8 @@ class Block { * Insert a block into the block table. Will fail if there is a conflicting * block (same name and options) already in the database. * - * @param $dbw DatabaseBase if you have one available - * @return mixed: false on failure, assoc array on success: + * @param DatabaseBase $dbw If you have one available + * @return bool|array False on failure, assoc array on success: * ('id' => block ID, 'autoIds' => array of autoblock IDs) */ public function insert( $dbw = null ) { @@ -482,8 +482,8 @@ class Block { /** * Get an array suitable for passing to $dbw->insert() or $dbw->update() - * @param $db DatabaseBase - * @return Array + * @param DatabaseBase $db + * @return array */ protected function getDatabaseArray( $db = null ) { if ( !$db ) { @@ -521,7 +521,7 @@ class Block { } /** - * @return Array + * @return array */ protected function getAutoblockUpdateArray() { return array( @@ -538,7 +538,7 @@ class Block { * Retroactively autoblocks the last IP used by the user (if it is a user) * blocked by this Block. * - * @return Array: block IDs of retroactive autoblocks made + * @return array Block IDs of retroactive autoblocks made */ protected function doRetroactiveAutoblock() { $blockIds = array(); @@ -562,7 +562,7 @@ class Block { * * @param Block $block * @param array &$blockIds - * @return Array: block IDs of retroactive autoblocks made + * @return array Block IDs of retroactive autoblocks made */ protected static function defaultRetroactiveAutoblock( Block $block, array &$blockIds ) { global $wgPutIPinRC; @@ -603,7 +603,7 @@ class Block { * TODO: this probably belongs somewhere else, but not sure where... * * @param string $ip The IP to check - * @return Boolean + * @return bool */ public static function isWhitelistedFromAutoblocks( $ip ) { global $wgMemc; @@ -645,8 +645,8 @@ class Block { /** * Autoblocks the given IP, referring to this Block. * - * @param string $autoblockIP the IP to autoblock. - * @return mixed: block ID if an autoblock was inserted, false if not. + * @param string $autoblockIP The IP to autoblock. + * @return int|bool Block ID if an autoblock was inserted, false if not. */ public function doAutoblock( $autoblockIP ) { # If autoblocks are disabled, go away. @@ -716,7 +716,7 @@ class Block { /** * Check if a block has expired. Delete it if it is. - * @return Boolean + * @return bool */ public function deleteIfExpired() { wfProfileIn( __METHOD__ ); @@ -736,7 +736,7 @@ class Block { /** * Has the block expired? - * @return Boolean + * @return bool */ public function isExpired() { $timestamp = wfTimestampNow(); @@ -751,7 +751,7 @@ class Block { /** * Is the block address valid (i.e. not a null string?) - * @return Boolean + * @return bool */ public function isValid() { return $this->getTarget() != null; @@ -782,7 +782,7 @@ class Block { /** * Get the IP address at the start of the range in Hex form * @throws MWException - * @return String IP in Hex form + * @return string IP in Hex form */ public function getRangeStart() { switch ( $this->type ) { @@ -801,7 +801,7 @@ class Block { /** * Get the IP address at the end of the range in Hex form * @throws MWException - * @return String IP in Hex form + * @return string IP in Hex form */ public function getRangeEnd() { switch ( $this->type ) { @@ -820,7 +820,7 @@ class Block { /** * Get the user id of the blocking sysop * - * @return Integer (0 for foreign users) + * @return int (0 for foreign users) */ public function getBy() { $blocker = $this->getBlocker(); @@ -832,7 +832,7 @@ class Block { /** * Get the username of the blocking sysop * - * @return String + * @return string */ public function getByName() { $blocker = $this->getBlocker(); @@ -852,8 +852,8 @@ class Block { /** * Get/set a flag determining whether the master is used for reads * - * @param $x Bool - * @return Bool + * @param bool $x + * @return bool */ public function fromMaster( $x = null ) { return wfSetVar( $this->mFromMaster, $x ); @@ -861,8 +861,8 @@ class Block { /** * Get/set whether the Block is a hardblock (affects logged-in users on a given IP/range - * @param $x Bool - * @return Bool + * @param bool $x + * @return bool */ public function isHardblock( $x = null ) { wfSetVar( $this->isHardblock, $x ); @@ -885,9 +885,9 @@ class Block { /** * Get/set whether the Block prevents a given action - * @param $action String - * @param $x Bool - * @return Bool + * @param string $action + * @param bool $x + * @return bool */ public function prevents( $action, $x = null ) { switch ( $action ) { @@ -911,7 +911,7 @@ class Block { /** * Get the block name, but with autoblocked IPs hidden as per standard privacy policy - * @return String, text is escaped + * @return string Text is escaped */ public function getRedactedName() { if ( $this->mAuto ) { @@ -928,8 +928,8 @@ class Block { /** * Get a timestamp of the expiry for autoblocks * - * @param $timestamp String|Int - * @return String + * @param string|int $timestamp + * @return string */ public static function getAutoblockExpiry( $timestamp ) { global $wgAutoblockExpiry; @@ -955,7 +955,7 @@ class Block { /** * Given a target and the target's type, get an existing Block object if possible. - * @param $specificTarget String|User|Int a block target, which may be one of several types: + * @param string|User|int $specificTarget A block target, which may be one of several types: * * A user to block, in which case $target will be a User * * An IP to block, in which case $target will be a User generated by using * User::newFromName( $ip, false ) to turn off name validation @@ -965,10 +965,10 @@ class Block { * Calling this with a user, IP address or range will not select autoblocks, and will * only select a block where the targets match exactly (so looking for blocks on * 1.2.3.4 will not select 1.2.0.0/16 or even 1.2.3.4/32) - * @param $vagueTarget String|User|Int as above, but we will search for *any* block which + * @param string|User|int $vagueTarget As above, but we will search for *any* block which * affects that target (so for an IP address, get ranges containing that IP; and also * get any relevant autoblocks). Leave empty or blank to skip IP-based lookups. - * @param bool $fromMaster whether to use the DB_MASTER database + * @param bool $fromMaster Whether to use the DB_MASTER database * @return Block|null (null if no relevant block could be found). The target and type * of the returned Block will refer to the actual block which was found, which might * not be the same as the target you gave if you used $vagueTarget! @@ -1006,11 +1006,11 @@ class Block { /** * Get all blocks that match any IP from an array of IP addresses * - * @param Array $ipChain list of IPs (strings), usually retrieved from the + * @param array $ipChain List of IPs (strings), usually retrieved from the * X-Forwarded-For header of the request - * @param Bool $isAnon Exclude anonymous-only blocks if false - * @param Bool $fromMaster Whether to query the master or slave database - * @return Array of Blocks + * @param bool $isAnon Exclude anonymous-only blocks if false + * @param bool $fromMaster Whether to query the master or slave database + * @return array Array of Blocks * @since 1.22 */ public static function getBlocksForIPList( array $ipChain, $isAnon, $fromMaster = false ) { @@ -1085,11 +1085,11 @@ class Block { * - If there are multiple exact or range blocks at the same level, the one chosen * is random - * @param Array $ipChain list of IPs (strings). This is used to determine how "close" + * @param array $ipChain List of IPs (strings). This is used to determine how "close" * a block is to the server, and if a block matches exactly, or is in a range. * The order is furthest from the server to nearest e.g., (Browser, proxy1, proxy2, * local-squid, ...) - * @param Array $block Array of blocks + * @param array $block Array of blocks * @return Block|null the "best" block from the list */ public static function chooseBlock( array $blocks, array $ipChain ) { @@ -1194,7 +1194,7 @@ class Block { * as a string; for User objects this will return User::__toString() * which in turn gives User::getName(). * - * @param $target String|Int|User|null + * @param string|int|User|null $target * @return array( User|String|null, Block::TYPE_ constant|null ) */ public static function parseTarget( $target ) { @@ -1251,7 +1251,7 @@ class Block { /** * Get the type of target for this particular block - * @return Block::TYPE_ constant, will never be TYPE_ID + * @return int Block::TYPE_ constant, will never be TYPE_ID */ public function getType() { return $this->mAuto @@ -1274,7 +1274,7 @@ class Block { * Get the target for this particular Block. Note that for autoblocks, * this returns the unredacted name; frontend functions need to call $block->getRedactedName() * in this situation. - * @return User|String + * @return User|string */ public function getTarget() { return $this->target; @@ -1283,7 +1283,7 @@ class Block { /** * @since 1.19 * - * @return Mixed|string + * @return mixed|string */ public function getExpiry() { return $this->mExpiry; @@ -1291,7 +1291,7 @@ class Block { /** * Set the target for this block, and update $this->type accordingly - * @param $target Mixed + * @param mixed $target */ public function setTarget( $target ) { list( $this->target, $this->type ) = self::parseTarget( $target ); @@ -1307,7 +1307,7 @@ class Block { /** * Set the user who implemented (or will implement) this block - * @param $user User|string Local User object or username string for foreign users + * @param User|string $user Local User object or username string for foreign users */ public function setBlocker( $user ) { $this->blocker = $user; diff --git a/includes/CacheHelper.php b/includes/CacheHelper.php index cfa4160e4c..695eac3a05 100644 --- a/includes/CacheHelper.php +++ b/includes/CacheHelper.php @@ -32,7 +32,7 @@ interface ICacheHelper { * Sets if the cache should be enabled or not. * * @since 1.20 - * @param boolean $cacheEnabled + * @param bool $cacheEnabled */ function setCacheEnabled( $cacheEnabled ); @@ -42,8 +42,8 @@ interface ICacheHelper { * * @since 1.20 * - * @param integer|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. - * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. + * @param int|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. + * @param bool|null $cacheEnabled Sets if the cache should be enabled or not. */ function startCache( $cacheExpiry = null, $cacheEnabled = null ); @@ -77,7 +77,7 @@ interface ICacheHelper { * * @since 1.20 * - * @param integer $cacheExpiry + * @param int $cacheExpiry */ function setExpiry( $cacheExpiry ); } @@ -105,7 +105,7 @@ class CacheHelper implements ICacheHelper { * The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry. * * @since 1.20 - * @var integer + * @var int */ protected $cacheExpiry = 3600; @@ -124,7 +124,7 @@ class CacheHelper implements ICacheHelper { * Null if this information is not available yet. * * @since 1.20 - * @var boolean|null + * @var bool|null */ protected $hasCached = null; @@ -132,7 +132,7 @@ class CacheHelper implements ICacheHelper { * If the cache is enabled or not. * * @since 1.20 - * @var boolean + * @var bool */ protected $cacheEnabled = true; @@ -156,7 +156,7 @@ class CacheHelper implements ICacheHelper { * Sets if the cache should be enabled or not. * * @since 1.20 - * @param boolean $cacheEnabled + * @param bool $cacheEnabled */ public function setCacheEnabled( $cacheEnabled ) { $this->cacheEnabled = $cacheEnabled; @@ -168,8 +168,8 @@ class CacheHelper implements ICacheHelper { * * @since 1.20 * - * @param integer|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. - * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. + * @param int|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. + * @param bool|null $cacheEnabled Sets if the cache should be enabled or not. */ public function startCache( $cacheExpiry = null, $cacheEnabled = null ) { if ( is_null( $this->hasCached ) ) { @@ -192,7 +192,7 @@ class CacheHelper implements ICacheHelper { * @since 1.20 * * @param IContextSource $context - * @param boolean $includePurgeLink + * @param bool $includePurgeLink * * @return string */ @@ -328,7 +328,7 @@ class CacheHelper implements ICacheHelper { * * @since 1.20 * - * @param integer $cacheExpiry + * @param int $cacheExpiry */ public function setExpiry( $cacheExpiry ) { $this->cacheExpiry = $cacheExpiry; @@ -378,7 +378,7 @@ class CacheHelper implements ICacheHelper { * * @since 1.20 * - * @param $handlerFunction + * @param callable $handlerFunction */ public function setOnInitializedHandler( $handlerFunction ) { $this->onInitHandler = $handlerFunction; diff --git a/includes/Category.php b/includes/Category.php index e326ce23cd..e235e4e94e 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -129,8 +129,8 @@ class Category { /** * Factory function. * - * @param $title Title for the category page - * @return Category|bool on a totally invalid name + * @param Title $title Title for the category page + * @return Category|bool On a totally invalid name */ public static function newFromTitle( $title ) { $cat = new self(); @@ -144,7 +144,7 @@ class Category { /** * Factory function. * - * @param $id Integer: a category id + * @param int $id A category id * @return Category */ public static function newFromID( $id ) { @@ -156,11 +156,11 @@ class Category { /** * Factory function, for constructing a Category object from a result set * - * @param $row Result set row, must contain the cat_xxx fields. If the + * @param object $row Result set row, must contain the cat_xxx fields. If the * fields are null, the resulting Category object will represent an empty * category if a title object was given. If the fields are null and no * title was given, this method fails and returns false. - * @param Title $title optional title object for the category represented by + * @param Title $title Optional title object for the category represented by * the given row. May be provided if it is already known, to avoid having * to re-create a title object later. * @return Category @@ -253,9 +253,9 @@ class Category { /** * Fetch a TitleArray of up to $limit category members, beginning after the * category sort key $offset. - * @param $limit integer - * @param $offset string - * @return TitleArray object for category members. + * @param int $limit + * @param string $offset + * @return TitleArray TitleArray object for category members. */ public function getMembers( $limit = false, $offset = '' ) { wfProfileIn( __METHOD__ ); diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 7f213c352c..305a8e5113 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -29,12 +29,12 @@ class CategoryViewer extends ContextSource { $imgsNoGallery; /** - * @var Array + * @var array */ var $nextPage; /** - * @var Array + * @var array */ var $flip; @@ -69,12 +69,12 @@ class CategoryViewer extends ContextSource { * Constructor * * @since 1.19 $context is a second, required parameter - * @param $title Title - * @param $context IContextSource + * @param Title $title + * @param IContextSource $context * @param array $from An array with keys page, subcat, * and file for offset of results of each section (since 1.17) * @param array $until An array with 3 keys for until of each section (since 1.17) - * @param $query Array + * @param array $query */ function __construct( $title, IContextSource $context, $from = array(), $until = array(), $query = array() @@ -162,9 +162,9 @@ class CategoryViewer extends ContextSource { /** * Add a subcategory to the internal lists, using a Category object - * @param $cat Category - * @param $sortkey - * @param $pageLength + * @param Category $cat + * @param string $sortkey + * @param int $pageLength */ function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) { // Subcategory; strip the 'Category' namespace from the link text. @@ -210,10 +210,10 @@ class CategoryViewer extends ContextSource { /** * Add a page in the image namespace - * @param $title Title - * @param $sortkey - * @param $pageLength - * @param $isRedirect bool + * @param Title $title + * @param string $sortkey + * @param int $pageLength + * @param bool $isRedirect */ function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; @@ -240,10 +240,10 @@ class CategoryViewer extends ContextSource { /** * Add a miscellaneous page - * @param $title - * @param $sortkey - * @param $pageLength - * @param $isRedirect bool + * @param Title $title + * @param string $sortkey + * @param int $pageLength + * @param bool $isRedirect */ function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; @@ -474,10 +474,10 @@ class CategoryViewer extends ContextSource { * Format a list of articles chunked by letter, either as a * bullet list or a columnar format, depending on the length. * - * @param $articles Array - * @param $articles_start_char Array - * @param $cutoff Int - * @return String + * @param array $articles + * @param array $articles_start_char + * @param int $cutoff + * @return string * @private */ function formatList( $articles, $articles_start_char, $cutoff = 6 ) { @@ -507,9 +507,9 @@ class CategoryViewer extends ContextSource { * More distant TODO: Scrap this and use CSS columns, whenever IE finally * supports those. * - * @param $articles Array - * @param $articles_start_char Array - * @return String + * @param array $articles + * @param string[] $articles_start_char + * @return string * @private */ static function columnList( $articles, $articles_start_char ) { @@ -563,9 +563,9 @@ class CategoryViewer extends ContextSource { /** * Format a list of articles chunked by letter in a bullet list. - * @param $articles Array - * @param $articles_start_char Array - * @return String + * @param array $articles + * @param string[] $articles_start_char + * @return string * @private */ static function shortList( $articles, $articles_start_char ) { @@ -590,7 +590,7 @@ class CategoryViewer extends ContextSource { * @param string $last The 'from' parameter for the generated URL * @param string $type A prefix for parameters, 'page' or 'subcat' or * 'file' - * @return String HTML + * @return string HTML */ private function pagingLinks( $first, $last, $type = '' ) { $prevLink = $this->msg( 'prevn' )->numParams( $this->limit )->escaped(); diff --git a/includes/Categoryfinder.php b/includes/Categoryfinder.php index 6ef224b607..720f6f8f30 100644 --- a/includes/Categoryfinder.php +++ b/includes/Categoryfinder.php @@ -64,8 +64,8 @@ class Categoryfinder { /** * Initializes the instance. Do this prior to calling run(). - * @param $article_ids Array of article IDs - * @param $categories FIXME + * @param array $article_ids Array of article IDs + * @param array $categories FIXME * @param string $mode FIXME, default 'AND'. * @todo FIXME: $categories/$mode */ @@ -113,7 +113,7 @@ class Categoryfinder { * This functions recurses through the parent representation, trying to match the conditions * @param int $id The article/category to check * @param array $conds The array of categories to match - * @param array $path used to check for recursion loops + * @param array $path Used to check for recursion loops * @return bool Does this match the conditions? */ function check( $id, &$conds, $path = array() ) { diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index f73ec1f27f..d3dd51aa54 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -65,8 +65,8 @@ class ChangeTags { * * @param string $tag tag * - * @return String: Short description of the tag from "mediawiki:tag-$tag" if this message exists, - * html-escaped version of $tag otherwise + * @return string Short description of the tag from "mediawiki:tag-$tag" if this message exists, + * html-escaped version of $tag otherwise */ public static function tagDescription( $tag ) { $msg = wfMessage( "tag-$tag" ); @@ -77,13 +77,13 @@ class ChangeTags { * Add tags to a change given its rc_id, rev_id and/or log_id * * @param string|array $tags Tags to add to the change - * @param $rc_id int: rc_id of the change to add the tags to - * @param $rev_id int: rev_id of the change to add the tags to - * @param $log_id int: log_id of the change to add the tags to + * @param int $rc_id rc_id of the change to add the tags to + * @param int $rev_id rev_id of the change to add the tags to + * @param int $log_id Log_id of the change to add the tags to * @param string $params params to put in the ct_params field of table 'change_tag' * * @throws MWException - * @return bool: false if no changes are made, otherwise true + * @return bool false if no changes are made, otherwise true * * @exception MWException when $rc_id, $rev_id and $log_id are all null */ @@ -192,9 +192,9 @@ class ChangeTags { * * @param string|array $tables Table names, see DatabaseBase::select * @param string|array $fields Fields used in query, see DatabaseBase::select - * @param string|array $conds conditions used in query, see DatabaseBase::select - * @param $join_conds Array: join conditions, see DatabaseBase::select - * @param array $options options, see Database::select + * @param string|array $conds Conditions used in query, see DatabaseBase::select + * @param array $join_conds Join conditions, see DatabaseBase::select + * @param array $options Options, see Database::select * @param bool|string $filter_tag Tag to select on * * @throws MWException When unable to determine appropriate JOIN condition for tagging @@ -238,12 +238,12 @@ class ChangeTags { * Build a text box to select a change tag * * @param string $selected tag to select by default - * @param $fullForm Boolean: + * @param bool $fullForm * - if false, then it returns an array of (label, form). * - if true, it returns an entire form around the selector. - * @param $title Title object to send the form to. + * @param Title $title Title object to send the form to. * Used when, and only when $fullForm is true. - * @return String or array: + * @return string|array * - if $fullForm is false: Array with * - if $fullForm is true: String, html fragment */ @@ -297,7 +297,7 @@ class ChangeTags { * * Tries memcached first. * - * @return Array of strings: tags + * @return string[] Array of strings: tags */ public static function listDefinedTags() { // Caching... diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index a5e5364800..fb491e50b3 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -31,8 +31,8 @@ class ChangesFeed { /** * Constructor * - * @param string $format feed's format (either 'rss' or 'atom') - * @param string $type type of feed (for cache keys) + * @param string $format Feed's format (either 'rss' or 'atom') + * @param string $type Type of feed (for cache keys) */ public function __construct( $format, $type ) { $this->format = $format; @@ -42,10 +42,10 @@ class ChangesFeed { /** * Get a ChannelFeed subclass object to use * - * @param string $title feed's title - * @param string $description feed's description - * @param string $url url of origin page - * @return ChannelFeed subclass or false on failure + * @param string $title Feed's title + * @param string $description Feed's description + * @param string $url Url of origin page + * @return ChannelFeed|bool ChannelFeed subclass or false on failure */ public function getFeedObject( $title, $description, $url ) { global $wgSitename, $wgLanguageCode, $wgFeedClasses; @@ -112,9 +112,9 @@ class ChangesFeed { /** * Save to feed result to $messageMemc * - * @param string $feed feed's content - * @param string $timekey memcached key of the last modification - * @param string $key memcached key of the content + * @param string $feed Feed's content + * @param string $timekey Memcached key of the last modification + * @param string $key Memcached key of the content */ public function saveToCache( $feed, $timekey, $key ) { global $messageMemc; @@ -126,10 +126,10 @@ class ChangesFeed { /** * Try to load the feed result from $messageMemc * - * @param $lastmod Integer: timestamp of the last item in the recentchanges table - * @param string $timekey memcached key of the last modification - * @param string $key memcached key of the content - * @return string|bool feed's content on cache hit or false on cache miss + * @param int $lastmod Timestamp of the last item in the recentchanges table + * @param string $timekey Memcached key of the last modification + * @param string $key Memcached key of the content + * @return string|bool Feed's content on cache hit or false on cache miss */ public function loadFromCache( $lastmod, $timekey, $key ) { global $wgFeedCacheTimeout, $wgOut, $messageMemc; @@ -163,8 +163,8 @@ class ChangesFeed { /** * Generate the feed items given a row from the database, printing the feed. - * @param $rows DatabaseBase resource with recentchanges rows - * @param $feed Feed object + * @param object $rows DatabaseBase resource with recentchanges rows + * @param Feed $feed */ public static function generateFeed( $rows, &$feed ) { wfProfileIn( __METHOD__ ); @@ -179,7 +179,7 @@ class ChangesFeed { /** * Generate the feed items given a row from the database. - * @param $rows DatabaseBase resource with recentchanges rows + * @param object $rows DatabaseBase resource with recentchanges rows */ public static function buildItems( $rows ) { wfProfileIn( __METHOD__ ); diff --git a/includes/Collation.php b/includes/Collation.php index 050ec63ffc..071a2785b1 100644 --- a/includes/Collation.php +++ b/includes/Collation.php @@ -551,7 +551,7 @@ class IcuCollation extends Collation { * This function will return false on older PHPs. * * @since 1.21 - * @return string|false + * @return string|bool */ static function getICUVersion() { return defined( 'INTL_ICU_VERSION' ) ? INTL_ICU_VERSION : false; @@ -562,7 +562,7 @@ class IcuCollation extends Collation { * currently in use, or false when it can't be determined. * * @since 1.21 - * @return string|false + * @return string|bool */ static function getUnicodeVersionForICU() { $icuVersion = IcuCollation::getICUVersion(); diff --git a/includes/Cookie.php b/includes/Cookie.php index e0a11a2073..b8d34e23cf 100644 --- a/includes/Cookie.php +++ b/includes/Cookie.php @@ -43,8 +43,8 @@ class Cookie { * cookies. Used internally after a request to parse the * Set-Cookie headers. * - * @param string $value the value of the cookie - * @param array $attr possible key/values: + * @param string $value The value of the cookie + * @param array $attr Possible key/values: * expires A date string * path The path this cookie is used on * domain Domain this cookie is used on @@ -85,9 +85,9 @@ class Cookie { * @todo fixme fails to detect 2-letter top-level domains for single-domain use (probably * not a big problem in practice, but there are test cases) * - * @param string $domain the domain to validate + * @param string $domain The domain to validate * @param string $originDomain (optional) the domain the cookie originates from - * @return Boolean + * @return bool */ public static function validateCookieDomain( $domain, $originDomain = null ) { // Don't allow a trailing dot @@ -149,9 +149,9 @@ class Cookie { /** * Serialize the cookie jar into a format useful for HTTP Request headers. * - * @param string $path the path that will be used. Required. - * @param string $domain the domain that will be used. Required. - * @return String + * @param string $path The path that will be used. Required. + * @param string $domain The domain that will be used. Required. + * @return string */ public function serializeToHttpRequest( $path, $domain ) { $ret = ''; @@ -166,7 +166,7 @@ class Cookie { } /** - * @param $domain + * @param string $domain * @return bool */ protected function canServeDomain( $domain ) { @@ -189,7 +189,7 @@ class Cookie { } /** - * @param $path + * @param string $path * @return bool */ protected function canServePath( $path ) { @@ -210,6 +210,9 @@ class CookieJar { /** * Set a cookie in the cookie jar. Make sure only one cookie per-name exists. * @see Cookie::set() + * @param string $name + * @param string $value + * @param array $attr */ public function setCookie( $name, $value, $attr ) { /* cookies: case insensitive, so this should work. @@ -226,6 +229,8 @@ class CookieJar { /** * @see Cookie::serializeToHttpRequest + * @param string $path + * @param string $domain * @return string */ public function serializeToHttpRequest( $path, $domain ) { @@ -245,8 +250,8 @@ class CookieJar { /** * Parse the content of an Set-Cookie HTTP Response header. * - * @param $cookie String - * @param string $domain cookie's domain + * @param string $cookie + * @param string $domain Cookie's domain * @return null */ public function parseCookieResponseHeader( $cookie, $domain ) { diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index b6860b93d5..91c9a75842 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -361,13 +361,6 @@ $wgDeletedDirectory = false; */ $wgImgAuthDetails = false; -/** - * If this is enabled, img_auth.php will not allow image access unless the wiki - * is private. This improves security when image uploads are hosted on a - * separate domain. - */ -$wgImgAuthPublicTest = true; - /** * Map of relative URL directories to match to internal mwstore:// base storage paths. * For img_auth.php requests, everything after "img_auth.php/" is checked to see @@ -1625,10 +1618,10 @@ $wgAllDBsAreLocalhost = false; * $wgSharedPrefix is the table prefix for the shared database. It defaults to * $wgDBprefix. * - * @deprecated In new code, use the $wiki parameter to wfGetLB() to access - * remote databases. Using wfGetLB() allows the shared database to reside on - * separate servers to the wiki's own database, with suitable configuration - * of $wgLBFactoryConf. + * @deprecated since 1.21 In new code, use the $wiki parameter to wfGetLB() to + * access remote databases. Using wfGetLB() allows the shared database to + * reside on separate servers to the wiki's own database, with suitable + * configuration of $wgLBFactoryConf. */ $wgSharedDB = null; diff --git a/includes/EditPage.php b/includes/EditPage.php index c266996082..c2803b69cf 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -225,7 +225,7 @@ class EditPage { /** * Has a summary been preset using GET parameter &summary= ? - * @var Bool + * @var bool */ var $hasPresetSummary = false; @@ -266,7 +266,7 @@ class EditPage { public $allowNonTextContent = false; /** - * @param $article Article + * @param Article $article */ public function __construct( Article $article ) { $this->mArticle = $article; @@ -296,7 +296,7 @@ class EditPage { /** * Set the context Title object * - * @param $title Title object or null + * @param Title|null $title Title object or null */ public function setContextTitle( $title ) { $this->mContextTitle = $title; @@ -307,7 +307,7 @@ class EditPage { * If not set, $wgTitle will be returned. This behavior might change in * the future to return $this->mTitle instead. * - * @return Title object + * @return Title */ public function getContextTitle() { if ( is_null( $this->mContextTitle ) ) { @@ -487,8 +487,8 @@ class EditPage { * "View source for ..." page displaying the source code after the error message. * * @since 1.19 - * @param array $permErrors of permissions errors, as returned by - * Title::getUserPermissionsErrors(). + * @param array $permErrors Array of permissions errors, as returned by + * Title::getUserPermissionsErrors(). * @throws PermissionsError */ protected function displayPermissionsError( array $permErrors ) { @@ -625,7 +625,7 @@ class EditPage { /** * This function collects the form data and uses it to populate various member variables. - * @param $request WebRequest + * @param WebRequest $request * @throws ErrorPageError */ function importFormData( &$request ) { @@ -819,7 +819,7 @@ class EditPage { * this method should be overridden and return the page text that will be used * for saving, preview parsing and so on... * - * @param $request WebRequest + * @param WebRequest $request */ protected function importContentFormData( &$request ) { return; // Don't do anything, EditPage already extracted wpTextbox1 @@ -828,7 +828,7 @@ class EditPage { /** * Initialise form fields in the object * Called on the first invocation, e.g. when a user clicks an edit link - * @return bool -- if the requested section is valid + * @return bool If the requested section is valid */ function initialiseForm() { global $wgUser; @@ -864,8 +864,8 @@ class EditPage { /** * Fetch initial editing page content. * - * @param $def_text string|bool - * @return mixed string on success, $def_text for invalid sections + * @param string|bool $def_text + * @return string|bool string on success, $def_text for invalid sections * @private * @deprecated since 1.21, get WikiPage::getContent() instead. */ @@ -887,7 +887,7 @@ class EditPage { /** * @param Content|null $def_content The default value to return * - * @return mixed Content on success, $def_content for invalid sections + * @return Content|null Content on success, $def_content for invalid sections * * @since 1.21 */ @@ -1074,7 +1074,7 @@ class EditPage { /** * Use this method before edit() to preload some text into the edit box * - * @param $text string + * @param string $text * @deprecated since 1.21, use setPreloadedContent() instead. */ public function setPreloadedText( $text ) { @@ -1088,7 +1088,7 @@ class EditPage { /** * Use this method before edit() to preload some content into the edit box * - * @param $content Content + * @param Content $content * * @since 1.21 */ @@ -1102,7 +1102,7 @@ class EditPage { * * @param string $preload representing the title to preload from. * - * @return String + * @return string * * @deprecated since 1.21, use getPreloadedContent() instead */ @@ -1119,8 +1119,8 @@ class EditPage { * Get the contents to be preloaded into the box, either set by * an earlier setPreloadText() or by loading the given page. * - * @param string $preload representing the title to preload from. - * @param Array $params Parameters to use (interface-message style) in the preloaded text + * @param string $preload Representing the title to preload from. + * @param array $params Parameters to use (interface-message style) in the preloaded text * * @return Content * @@ -1186,7 +1186,7 @@ class EditPage { /** * Make sure the form isn't faking a user's credentials. * - * @param $request WebRequest + * @param WebRequest $request * @return bool * @private */ @@ -1345,7 +1345,7 @@ class EditPage { /** * Run hooks that can filter edits just before they get saved. * - * @param Content $content the Content to filter. + * @param Content $content The Content to filter. * @param Status $status For reporting the outcome to the caller * @param User $user The user performing the edit * @@ -1393,14 +1393,14 @@ class EditPage { /** * Attempt submission (no UI) * - * @param array $result array to add statuses to, currently with the possible keys: + * @param array $result Array to add statuses to, currently with the possible keys: * spam - string - Spam string from content if any spam is detected by matchSpamRegex * sectionanchor - string - Section anchor for a section save * nullEdit - boolean - Set if doEditContent is OK. True if null edit, false otherwise. * redirect - boolean - Set if doEditContent is OK. True if resulting revision is a redirect * @param bool $bot True if edit is being made under the bot right. * - * @return Status object, possibly with a message, but always with one of the AS_* constants in $status->value, + * @return Status Status object, possibly with a message, but always with one of the AS_* constants in $status->value, * * FIXME: This interface is TERRIBLE, but hard to get rid of due to various error display idiosyncrasies. There are * also lots of cases where error metadata is set in the object and retrieved later instead of being returned, e.g. @@ -1866,7 +1866,7 @@ class EditPage { /** * Attempts to merge text content with base and current revisions * - * @param $editText string + * @param string $editText * * @return bool * @deprecated since 1.21, use mergeChangesIntoContent() instead @@ -1892,7 +1892,7 @@ class EditPage { * * @since 1.21 * - * @param $editContent + * @param Content $editContent * * @return bool */ @@ -1948,9 +1948,9 @@ class EditPage { /** * Check given input text against $wgSpamRegex, and return the text of the first match. * - * @param $text string + * @param string $text * - * @return string|bool matching string or false + * @return string|bool Matching string or false */ public static function matchSpamRegex( $text ) { global $wgSpamRegex; @@ -1962,9 +1962,9 @@ class EditPage { /** * Check given input text against $wgSummarySpamRegex, and return the text of the first match. * - * @param $text string + * @param string $text * - * @return string|bool matching string or false + * @return string|bool Matching string or false */ public static function matchSummarySpamRegex( $text ) { global $wgSummarySpamRegex; @@ -1973,8 +1973,8 @@ class EditPage { } /** - * @param $text string - * @param $regexes array + * @param string $text + * @param array $regexes * @return bool|string */ protected static function matchSpamRegexInternal( $text, $regexes ) { @@ -2153,7 +2153,7 @@ class EditPage { * content. * * @param Content|null|bool|string $content - * @return String the editable text form of the content. + * @return string The editable text form of the content. * * @throws MWException if $content is not an instance of TextContent and $this->allowNonTextContent is not true. */ @@ -2206,7 +2206,7 @@ class EditPage { /** * Send the edit form and related headers to $wgOut - * @param $formCallback Callback|null that takes an OutputPage parameter; will be called + * @param callable|null $formCallback That takes an OutputPage parameter; will be called * during form output near the top, for captchas and the like. */ function showEditForm( $formCallback = null ) { @@ -2401,7 +2401,7 @@ class EditPage { * Extract the section title from current section text, if any. * * @param string $text - * @return Mixed|string or false + * @return string|bool string or false */ public static function extractSectionTitle( $text ) { preg_match( "/^(=+)(.+)\\1\\s*(\n|$)/i", $text, $matches ); @@ -2576,8 +2576,8 @@ class EditPage { * * @param string $summary The value of the summary input * @param string $labelText The html to place inside the label - * @param array $inputAttrs of attrs to use on the input - * @param array $spanLabelAttrs of attrs to use on the span inside the label + * @param array $inputAttrs Array of attrs to use on the input + * @param array $spanLabelAttrs Array of attrs to use on the span inside the label * * @return array An array in the format array( $label, $input ) */ @@ -2637,7 +2637,7 @@ class EditPage { * @param bool $isSubjectPreview true if this is the section subject/title * up top, or false if this is the comment summary * down below the textarea - * @param string $summary the text of the summary to display + * @param string $summary The text of the summary to display * @return string */ protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) { @@ -2710,8 +2710,8 @@ HTML * The $textoverride method can be used by subclasses overriding showContentForm * to pass back to this method. * - * @param array $customAttribs of html attributes to use in the textarea - * @param string $textoverride optional text to override $this->textarea1 with + * @param array $customAttribs Array of html attributes to use in the textarea + * @param string $textoverride Optional text to override $this->textarea1 with */ protected function showTextbox1( $customAttribs = null, $textoverride = null ) { if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) { @@ -2817,7 +2817,7 @@ HTML * Append preview output to $wgOut. * Includes category rendering if this is a category page. * - * @param string $text the HTML to be output for the preview. + * @param string $text The HTML to be output for the preview. */ protected function showPreview( $text ) { global $wgOut; @@ -2946,8 +2946,7 @@ HTML * Get the copyright warning, by default returns wikitext * * @param Title $title - * @param string $format output format, valid values are any function of - * a Message object + * @param string $format Output format, valid values are any function of a Message object * @return string */ public static function getCopyrightWarning( $title, $format = 'plain' ) { @@ -3106,7 +3105,7 @@ HTML * variable in the constructor is not enough. This can be used when the * EditPage lives inside of a Special page rather than a custom page action. * - * @param $title Title object for which is being edited (where we go to for &action= links) + * @param Title $title Title object for which is being edited (where we go to for &action= links) * @return string */ protected function getActionURL( Title $title ) { @@ -3118,6 +3117,7 @@ HTML * Note that we rely on the logging table, which hasn't been always there, * but that doesn't matter, because this only applies to brand new * deletes. + * @return bool */ protected function wasDeletedSinceLastEdit() { if ( $this->deletedSinceEdit !== null ) { @@ -3313,7 +3313,7 @@ HTML } /** - * @return Array + * @return array */ function getTemplates() { if ( $this->preview || $this->section != '' ) { @@ -3494,7 +3494,7 @@ HTML * minor and watch * * @param int $tabindex Current tabindex - * @param array $checked of checkbox => bool, where bool indicates the checked + * @param array $checked Array of checkbox => bool, where bool indicates the checked * status of the checkbox * * @return array @@ -3673,7 +3673,7 @@ HTML /** * Show "your edit contains spam" page with your diff and text * - * @param $match string|Array|bool Text (or array of texts) which triggered one or more filters + * @param string|array|bool $match Text (or array of texts) which triggered one or more filters */ public function spamPageWithContent( $match = false ) { global $wgOut, $wgLang; diff --git a/includes/Export.php b/includes/Export.php index 0ebdb7868b..7295a761af 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -97,7 +97,7 @@ class WikiExporter { * various row objects and XML output for filtering. Filters * can be chained or used as callbacks. * - * @param $sink mixed + * @param DumpOutput $sink */ public function setOutputSink( &$sink ) { $this->sink =& $sink; @@ -125,7 +125,7 @@ class WikiExporter { /** * Dumps a series of page and revision records for those pages * in the database falling within the page_id range given. - * @param int $start inclusive lower limit (this id is included) + * @param int $start Inclusive lower limit (this id is included) * @param int $end Exclusive upper limit (this id is not included) * If 0, no upper limit. */ @@ -140,7 +140,7 @@ class WikiExporter { /** * Dumps a series of page and revision records for those pages * in the database with revisions falling within the rev_id range given. - * @param int $start inclusive lower limit (this id is included) + * @param int $start Inclusive lower limit (this id is included) * @param int $end Exclusive upper limit (this id is not included) * If 0, no upper limit. */ @@ -153,7 +153,7 @@ class WikiExporter { } /** - * @param $title Title + * @param Title $title */ public function pageByTitle( $title ) { $this->dumpFrom( @@ -162,7 +162,7 @@ class WikiExporter { } /** - * @param $name string + * @param string $name * @throws MWException */ public function pageByName( $name ) { @@ -175,7 +175,7 @@ class WikiExporter { } /** - * @param $names array + * @param array $names */ public function pagesByName( $names ) { foreach ( $names as $name ) { @@ -188,8 +188,8 @@ class WikiExporter { } /** - * @param $start int - * @param $end int + * @param int $start + * @param int $end */ public function logsByRange( $start, $end ) { $condition = 'log_id >= ' . intval( $start ); @@ -204,7 +204,7 @@ class WikiExporter { * Not called by default (depends on $this->list_authors) * Can be set by Special:Export when not exporting whole history * - * @param $cond + * @param array $cond */ protected function do_list_authors( $cond ) { wfProfileIn( __METHOD__ ); @@ -237,7 +237,7 @@ class WikiExporter { } /** - * @param $cond string + * @param string $cond * @throws MWException * @throws Exception */ @@ -426,7 +426,7 @@ class WikiExporter { * separate database connection not managed by LoadBalancer; some * blob storage types will make queries to pull source data. * - * @param $resultset ResultWrapper + * @param ResultWrapper $resultset */ protected function outputPageStream( $resultset ) { $last = null; @@ -461,7 +461,7 @@ class WikiExporter { } /** - * @param $resultset array + * @param array $resultset */ protected function outputLogStream( $resultset ) { foreach ( $resultset as $row ) { @@ -591,7 +591,7 @@ class XmlDumpWriter { * Opens a "" section on the output stream, with data * from the given database row. * - * @param $row object + * @param object $row * @return string */ public function openPage( $row ) { @@ -634,7 +634,7 @@ class XmlDumpWriter { * Dumps a "" section on the output stream, with * data filled in from the given database row. * - * @param $row object + * @param object $row * @return string * @access private */ @@ -723,7 +723,7 @@ class XmlDumpWriter { * Dumps a "" section on the output stream, with * data filled in from the given database row. * - * @param $row object + * @param object $row * @return string * @access private */ @@ -767,7 +767,7 @@ class XmlDumpWriter { } /** - * @param $timestamp string + * @param string $timestamp * @param string $indent Default to six spaces * @return string */ @@ -777,8 +777,8 @@ class XmlDumpWriter { } /** - * @param $id - * @param $text string + * @param int $id + * @param string $text * @param string $indent Default to six spaces * @return string */ @@ -796,8 +796,8 @@ class XmlDumpWriter { /** * Warning! This data is potentially inconsistent. :( - * @param $row - * @param $dumpContents bool + * @param object $row + * @param bool $dumpContents * @return string */ function writeUploads( $row, $dumpContents = false ) { @@ -817,7 +817,7 @@ class XmlDumpWriter { /** * @param File $file - * @param $dumpContents bool + * @param bool $dumpContents * @return string */ function writeUpload( $file, $dumpContents = false ) { @@ -891,45 +891,45 @@ class XmlDumpWriter { class DumpOutput { /** - * @param $string string + * @param string $string */ function writeOpenStream( $string ) { $this->write( $string ); } /** - * @param $string string + * @param string $string */ function writeCloseStream( $string ) { $this->write( $string ); } /** - * @param $page - * @param $string string + * @param object $page + * @param string $string */ function writeOpenPage( $page, $string ) { $this->write( $string ); } /** - * @param $string string + * @param string $string */ function writeClosePage( $string ) { $this->write( $string ); } /** - * @param $rev - * @param $string string + * @param object $rev + * @param string $string */ function writeRevision( $rev, $string ) { $this->write( $string ); } /** - * @param $rev - * @param $string string + * @param object $rev + * @param string $string */ function writeLogItem( $rev, $string ) { $this->write( $string ); @@ -937,7 +937,7 @@ class DumpOutput { /** * Override to write to a different stream type. - * @param $string string + * @param string $string * @return bool */ function write( $string ) { @@ -949,7 +949,7 @@ class DumpOutput { * and reopen new file with the old name. Use this * for writing out a file in multiple pieces * at specified checkpoints (e.g. every n hours). - * @param $newname mixed File name. May be a string or an array with one element + * @param string|array $newname File name. May be a string or an array with one element */ function closeRenameAndReopen( $newname ) { } @@ -958,7 +958,7 @@ class DumpOutput { * Close the old file, and move it to a specified name. * Use this for the last piece of a file written out * at specified checkpoints (e.g. every n hours). - * @param $newname mixed File name. May be a string or an array with one element + * @param string|array $newname File name. May be a string or an array with one element * @param bool $open If true, a new file with the old filename will be opened * again for writing (default: false) */ @@ -983,7 +983,7 @@ class DumpFileOutput extends DumpOutput { protected $handle = false, $filename; /** - * @param $file + * @param string $file */ function __construct( $file ) { $this->handle = fopen( $file, "wt" ); @@ -991,7 +991,7 @@ class DumpFileOutput extends DumpOutput { } /** - * @param $string string + * @param string $string */ function writeCloseStream( $string ) { parent::writeCloseStream( $string ); @@ -1002,21 +1002,21 @@ class DumpFileOutput extends DumpOutput { } /** - * @param $string string + * @param string $string */ function write( $string ) { fputs( $this->handle, $string ); } /** - * @param $newname + * @param string $newname */ function closeRenameAndReopen( $newname ) { $this->closeAndRename( $newname, true ); } /** - * @param $newname + * @param string $newname * @throws MWException */ function renameOrException( $newname ) { @@ -1026,8 +1026,8 @@ class DumpFileOutput extends DumpOutput { } /** - * @param $newname array - * @return mixed + * @param array $newname + * @return string * @throws MWException */ function checkRenameArgCount( $newname ) { @@ -1042,8 +1042,8 @@ class DumpFileOutput extends DumpOutput { } /** - * @param $newname mixed - * @param $open bool + * @param string $newname + * @param bool $open */ function closeAndRename( $newname, $open = false ) { $newname = $this->checkRenameArgCount( $newname ); @@ -1078,8 +1078,8 @@ class DumpPipeOutput extends DumpFileOutput { protected $procOpenResource = false; /** - * @param $command - * @param $file null + * @param string $command + * @param string $file */ function __construct( $command, $file = null ) { if ( !is_null( $file ) ) { @@ -1092,7 +1092,7 @@ class DumpPipeOutput extends DumpFileOutput { } /** - * @param $string string + * @param string $string */ function writeCloseStream( $string ) { parent::writeCloseStream( $string ); @@ -1103,7 +1103,7 @@ class DumpPipeOutput extends DumpFileOutput { } /** - * @param $command + * @param string $command */ function startCommand( $command ) { $spec = array( @@ -1115,15 +1115,15 @@ class DumpPipeOutput extends DumpFileOutput { } /** - * @param mixed $newname + * @param string $newname */ function closeRenameAndReopen( $newname ) { $this->closeAndRename( $newname, true ); } /** - * @param $newname mixed - * @param $open bool + * @param string $newname + * @param bool $open */ function closeAndRename( $newname, $open = false ) { $newname = $this->checkRenameArgCount( $newname ); @@ -1154,7 +1154,7 @@ class DumpPipeOutput extends DumpFileOutput { class DumpGZipOutput extends DumpPipeOutput { /** - * @param $file string + * @param string $file */ function __construct( $file ) { parent::__construct( "gzip", $file ); @@ -1168,7 +1168,7 @@ class DumpGZipOutput extends DumpPipeOutput { class DumpBZip2Output extends DumpPipeOutput { /** - * @param $file string + * @param string $file */ function __construct( $file ) { parent::__construct( "bzip2", $file ); @@ -1182,7 +1182,7 @@ class DumpBZip2Output extends DumpPipeOutput { class Dump7ZipOutput extends DumpPipeOutput { /** - * @param $file string + * @param string $file */ function __construct( $file ) { $command = $this->setup7zCommand( $file ); @@ -1191,7 +1191,7 @@ class Dump7ZipOutput extends DumpPipeOutput { } /** - * @param $file string + * @param string $file * @return string */ function setup7zCommand( $file ) { @@ -1203,8 +1203,8 @@ class Dump7ZipOutput extends DumpPipeOutput { } /** - * @param $newname string - * @param $open bool + * @param string $newname + * @param bool $open */ function closeAndRename( $newname, $open = false ) { $newname = $this->checkRenameArgCount( $newname ); @@ -1241,29 +1241,29 @@ class DumpFilter { protected $sendingThisPage; /** - * @param $sink DumpOutput + * @param DumpOutput $sink */ function __construct( &$sink ) { $this->sink =& $sink; } /** - * @param $string string + * @param string $string */ function writeOpenStream( $string ) { $this->sink->writeOpenStream( $string ); } /** - * @param $string string + * @param string $string */ function writeCloseStream( $string ) { $this->sink->writeCloseStream( $string ); } /** - * @param $page - * @param $string string + * @param object $page + * @param string $string */ function writeOpenPage( $page, $string ) { $this->sendingThisPage = $this->pass( $page, $string ); @@ -1273,7 +1273,7 @@ class DumpFilter { } /** - * @param $string string + * @param string $string */ function writeClosePage( $string ) { if ( $this->sendingThisPage ) { @@ -1283,8 +1283,8 @@ class DumpFilter { } /** - * @param $rev - * @param $string string + * @param object $rev + * @param string $string */ function writeRevision( $rev, $string ) { if ( $this->sendingThisPage ) { @@ -1293,23 +1293,23 @@ class DumpFilter { } /** - * @param $rev - * @param $string string + * @param object $rev + * @param string $string */ function writeLogItem( $rev, $string ) { $this->sink->writeRevision( $rev, $string ); } /** - * @param $newname string + * @param string $newname */ function closeRenameAndReopen( $newname ) { $this->sink->closeRenameAndReopen( $newname ); } /** - * @param $newname string - * @param $open bool + * @param string $newname + * @param bool $open */ function closeAndRename( $newname, $open = false ) { $this->sink->closeAndRename( $newname, $open ); @@ -1324,7 +1324,7 @@ class DumpFilter { /** * Override for page-based filter types. - * @param $page + * @param object $page * @return bool */ function pass( $page ) { @@ -1339,7 +1339,7 @@ class DumpFilter { class DumpNotalkFilter extends DumpFilter { /** - * @param $page + * @param object $page * @return bool */ function pass( $page ) { @@ -1356,8 +1356,8 @@ class DumpNamespaceFilter extends DumpFilter { var $namespaces = array(); /** - * @param $sink DumpOutput - * @param $param + * @param DumpOutput $sink + * @param array $param * @throws MWException */ function __construct( &$sink, $param ) { @@ -1403,7 +1403,7 @@ class DumpNamespaceFilter extends DumpFilter { } /** - * @param $page + * @param object $page * @return bool */ function pass( $page ) { @@ -1420,8 +1420,8 @@ class DumpLatestFilter extends DumpFilter { var $page, $pageString, $rev, $revString; /** - * @param $page - * @param $string string + * @param object $page + * @param string $string */ function writeOpenPage( $page, $string ) { $this->page = $page; @@ -1429,7 +1429,7 @@ class DumpLatestFilter extends DumpFilter { } /** - * @param $string string + * @param string $string */ function writeClosePage( $string ) { if ( $this->rev ) { @@ -1444,8 +1444,8 @@ class DumpLatestFilter extends DumpFilter { } /** - * @param $rev - * @param $string string + * @param object $rev + * @param string $string */ function writeRevision( $rev, $string ) { if ( $rev->rev_id == $this->page->page_latest ) { @@ -1462,7 +1462,7 @@ class DumpLatestFilter extends DumpFilter { class DumpMultiWriter { /** - * @param $sinks + * @param array $sinks */ function __construct( $sinks ) { $this->sinks = $sinks; @@ -1470,7 +1470,7 @@ class DumpMultiWriter { } /** - * @param $string string + * @param string $string */ function writeOpenStream( $string ) { for ( $i = 0; $i < $this->count; $i++ ) { @@ -1479,7 +1479,7 @@ class DumpMultiWriter { } /** - * @param $string string + * @param string $string */ function writeCloseStream( $string ) { for ( $i = 0; $i < $this->count; $i++ ) { @@ -1488,8 +1488,8 @@ class DumpMultiWriter { } /** - * @param $page - * @param $string string + * @param object $page + * @param string $string */ function writeOpenPage( $page, $string ) { for ( $i = 0; $i < $this->count; $i++ ) { @@ -1498,7 +1498,7 @@ class DumpMultiWriter { } /** - * @param $string + * @param string $string */ function writeClosePage( $string ) { for ( $i = 0; $i < $this->count; $i++ ) { @@ -1507,8 +1507,8 @@ class DumpMultiWriter { } /** - * @param $rev - * @param $string + * @param object $rev + * @param string $string */ function writeRevision( $rev, $string ) { for ( $i = 0; $i < $this->count; $i++ ) { @@ -1517,14 +1517,14 @@ class DumpMultiWriter { } /** - * @param $newnames + * @param array $newnames */ function closeRenameAndReopen( $newnames ) { $this->closeAndRename( $newnames, true ); } /** - * @param $newnames array + * @param array $newnames * @param bool $open */ function closeAndRename( $newnames, $open = false ) { @@ -1547,7 +1547,7 @@ class DumpMultiWriter { } /** - * @param $string string + * @param string $string * @return string */ function xmlsafe( $string ) { diff --git a/includes/Fallback.php b/includes/Fallback.php index cdf6c88ec3..e38bdf1a70 100644 --- a/includes/Fallback.php +++ b/includes/Fallback.php @@ -26,9 +26,9 @@ class Fallback { /** - * @param $from - * @param $to - * @param $string + * @param string $from + * @param string $to + * @param string $string * @return string */ public static function iconv( $from, $to, $string ) { @@ -57,9 +57,9 @@ class Fallback { * can be up to 100x slower than native if the text is heavily * multibyte and we have to slog through a few hundred kb. * - * @param $str - * @param $start - * @param $count string + * @param string $str + * @param int $start + * @param string $count * * @return string */ @@ -78,8 +78,8 @@ class Fallback { } /** - * @param $str - * @param $splitPos + * @param string $str + * @param int $splitPos * @return int */ public static function mb_substr_split_unicode( $str, $splitPos ) { @@ -130,7 +130,7 @@ class Fallback { /** * Fallback implementation of mb_strlen, hardcoded to UTF-8. * @param string $str - * @param string $enc optional encoding; ignored + * @param string $enc Optional encoding; ignored * @return int */ public static function mb_strlen( $str, $enc = '' ) { @@ -151,10 +151,10 @@ class Fallback { /** * Fallback implementation of mb_strpos, hardcoded to UTF-8. - * @param $haystack String - * @param $needle String - * @param string $offset optional start position - * @param string $encoding optional encoding; ignored + * @param string $haystack + * @param string $needle + * @param string $offset Optional start position + * @param string $encoding Optional encoding; ignored * @return int */ public static function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) { @@ -172,8 +172,8 @@ class Fallback { /** * Fallback implementation of mb_strrpos, hardcoded to UTF-8. - * @param $haystack String - * @param $needle String + * @param string $haystack + * @param string $needle * @param string $offset optional start position * @param string $encoding optional encoding; ignored * @return int diff --git a/includes/Feed.php b/includes/Feed.php index d5a95535f3..1b995195cb 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -53,11 +53,11 @@ class FeedItem { * Constructor * * @param string|Title $title Item's title - * @param $description String + * @param string $description * @param string $url URL uniquely designating the item. * @param string $date Item's date * @param string $author Author's user name - * @param $comments String + * @param string $comments */ function __construct( $title, $description, $url, $date = '', $author = '', $comments = '' ) { $this->title = $title; @@ -72,8 +72,8 @@ class FeedItem { /** * Encode $string so that it can be safely embedded in a XML document * - * @param string $string string to encode - * @return String + * @param string $string String to encode + * @return string */ public function xmlEncode( $string ) { $string = str_replace( "\r\n", "\n", $string ); @@ -84,7 +84,7 @@ class FeedItem { /** * Get the unique id of this item * - * @return String + * @return string */ public function getUniqueId() { if ( $this->uniqueId ) { @@ -95,8 +95,8 @@ class FeedItem { /** * set the unique id of an item * - * @param string $uniqueId unique id for the item - * @param $rssIsPermalink Boolean: set to true if the guid (unique id) is a permalink (RSS feeds only) + * @param string $uniqueId Unique id for the item + * @param bool $rssIsPermalink Set to true if the guid (unique id) is a permalink (RSS feeds only) */ public function setUniqueId( $uniqueId, $rssIsPermalink = false ) { $this->uniqueId = $uniqueId; @@ -106,7 +106,7 @@ class FeedItem { /** * Get the title of this item; already xml-encoded * - * @return String + * @return string */ public function getTitle() { return $this->xmlEncode( $this->title ); @@ -115,7 +115,7 @@ class FeedItem { /** * Get the URL of this item; already xml-encoded * - * @return String + * @return string */ public function getUrl() { return $this->xmlEncode( $this->url ); @@ -124,7 +124,7 @@ class FeedItem { /** * Get the description of this item; already xml-encoded * - * @return String + * @return string */ public function getDescription() { return $this->xmlEncode( $this->description ); @@ -133,7 +133,7 @@ class FeedItem { /** * Get the language of this item * - * @return String + * @return string */ public function getLanguage() { global $wgLanguageCode; @@ -143,7 +143,7 @@ class FeedItem { /** * Get the title of this item * - * @return String + * @return string */ public function getDate() { return $this->date; @@ -152,7 +152,7 @@ class FeedItem { /** * Get the author of this item; already xml-encoded * - * @return String + * @return string */ public function getAuthor() { return $this->xmlEncode( $this->author ); @@ -161,7 +161,7 @@ class FeedItem { /** * Get the comment of this item; already xml-encoded * - * @return String + * @return string */ public function getComments() { return $this->xmlEncode( $this->comments ); @@ -171,7 +171,7 @@ class FeedItem { * Quickie hack... strip out wikilinks to more legible form from the comment. * * @param string $text wikitext - * @return String + * @return string */ public static function stripComment( $text ) { return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text ); @@ -190,7 +190,6 @@ abstract class ChannelFeed extends FeedItem { * @code * print ""; * @endcode - * @param $item */ abstract public function outHeader(); @@ -200,7 +199,7 @@ abstract class ChannelFeed extends FeedItem { * @code * print "..."; * @endcode - * @param $item + * @param FeedItem $item */ abstract public function outItem( $item ); @@ -274,8 +273,8 @@ class RSSFeed extends ChannelFeed { /** * Format a date given a timestamp * - * @param $ts Integer: timestamp - * @return String: date string + * @param int $ts Timestamp + * @return string Date string */ function formatTime( $ts ) { return gmdate( 'D, d M Y H:i:s \G\M\T', wfTimestamp( TS_UNIX, $ts ) ); @@ -301,7 +300,7 @@ class RSSFeed extends ChannelFeed { /** * Output an RSS 2.0 item - * @param $item FeedItem: item to be output + * @param FeedItem $item Item to be output */ function outItem( $item ) { ?> @@ -386,7 +385,7 @@ class AtomFeed extends ChannelFeed { /** * Output a given item. - * @param $item + * @param FeedItem $item */ function outItem( $item ) { global $wgMimeType; diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index 22cb52beba..d407a0e1ad 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -33,8 +33,8 @@ class FeedUtils { * If the feed should be purged; $timekey and $key will be removed from * $messageMemc * - * @param string $timekey cache key of the timestamp of the last item - * @param string $key cache key of feed's content + * @param string $timekey Cache key of the timestamp of the last item + * @param string $key Cache key of feed's content */ public static function checkPurge( $timekey, $key ) { global $wgRequest, $wgUser, $messageMemc; @@ -49,7 +49,7 @@ class FeedUtils { * Check whether feeds can be used and that $type is a valid feed type * * @param string $type feed type, as requested by the user - * @return Boolean + * @return bool */ public static function checkFeedOutput( $type ) { global $wgOut, $wgFeed, $wgFeedClasses; @@ -70,8 +70,8 @@ class FeedUtils { /** * Format a diff for the newsfeed * - * @param $row Object: row from the recentchanges table - * @return String + * @param object $row Row from the recentchanges table + * @return string */ public static function formatDiff( $row ) { $titleObj = Title::makeTitle( $row->rc_namespace, $row->rc_title ); @@ -94,13 +94,13 @@ class FeedUtils { /** * Really format a diff for the newsfeed * - * @param $title Title object - * @param $oldid Integer: old revision's id - * @param $newid Integer: new revision's id - * @param $timestamp Integer: new revision's timestamp - * @param string $comment new revision's comment - * @param string $actiontext text of the action; in case of log event - * @return String + * @param Title $title Title object + * @param int $oldid Old revision's id + * @param int $newid New revision's id + * @param int $timestamp New revision's timestamp + * @param string $comment New revision's comment + * @param string $actiontext Text of the action; in case of log event + * @return string */ public static function formatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext = '' ) { global $wgFeedDiffCutoff, $wgLang; @@ -214,9 +214,9 @@ class FeedUtils { * Generates a diff link. Used when the full diff is not wanted for example * when $wgFeedDiffCutoff is 0. * - * @param $title Title object: used to generate the diff URL - * @param $newid Integer newid for this diff - * @param $oldid Integer|null oldid for the diff. Null means it is a new article + * @param Title $title Title object: used to generate the diff URL + * @param int $newid Newid for this diff + * @param int|null $oldid Oldid for the diff. Null means it is a new article * @return string */ protected static function getDiffLink( Title $title, $newid, $oldid = null ) { @@ -237,8 +237,8 @@ class FeedUtils { * Might be 'cleaner' to use DOM or XSLT or something, * but *gack* it's a pain in the ass. * - * @param string $text diff's HTML output - * @return String: modified HTML + * @param string $text Diff's HTML output + * @return string Modified HTML */ public static function applyDiffStyle( $text ) { $styles = array( diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 444d26f34a..44aaeb4a6e 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -303,8 +303,8 @@ class FileDeleteForm { * showing an appropriate message depending upon whether * it's a current file or an old version * - * @param string $message message base - * @return String + * @param string $message Message base + * @return string */ private function prepareMessage( $message ) { global $wgLang; @@ -336,6 +336,7 @@ class FileDeleteForm { /** * Is the provided `oldimage` value valid? * + * @param string $oldimage * @return bool */ public static function isValidOldSpec( $oldimage ) { @@ -349,9 +350,9 @@ class FileDeleteForm { * value was provided, does it correspond to an * existing, local, old version of this file? * - * @param $file File - * @param $oldfile File - * @param $oldimage File + * @param File $file + * @param File $oldfile + * @param File $oldimage * @return bool */ public static function haveDeletableFile( &$file, &$oldfile, $oldimage ) { diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b1328261de..d94d2f13f5 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -108,8 +108,8 @@ if ( !function_exists( 'gzdecode' ) ) { /** * Like array_diff( $a, $b ) except that it works with two-dimensional arrays. - * @param $a array - * @param $b array + * @param array $a + * @param array $b * @return array */ function wfArrayDiff2( $a, $b ) { @@ -117,8 +117,8 @@ function wfArrayDiff2( $a, $b ) { } /** - * @param $a array|string - * @param $b array|string + * @param array|string $a + * @param array|string $b * @return int */ function wfArrayDiff2_cmp( $a, $b ) { @@ -145,8 +145,8 @@ function wfArrayDiff2_cmp( $a, $b ) { * values in array $a with the corresponding keys * * @deprecated since 1.22; use array_intersect_key() - * @param $a Array - * @param $b Array + * @param array $a + * @param array $b * @return array */ function wfArrayLookup( $a, $b ) { @@ -157,10 +157,10 @@ function wfArrayLookup( $a, $b ) { /** * Appends to second array if $value differs from that in $default * - * @param $key String|Int - * @param $value Mixed - * @param $default Mixed - * @param array $changed to alter + * @param string|int $key + * @param mixed $value + * @param mixed $default + * @param array $changed Array to alter * @throws MWException */ function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) { @@ -231,8 +231,8 @@ function wfMergeErrorArrays( /*...*/ ) { * * @param array $array The array. * @param array $insert The array to insert. - * @param $after Mixed: The key to insert after - * @return Array + * @param mixed $after The key to insert after + * @return array */ function wfArrayInsertAfter( array $array, array $insert, $after ) { // Find the offset of the element to insert after. @@ -253,9 +253,9 @@ function wfArrayInsertAfter( array $array, array $insert, $after ) { /** * Recursively converts the parameter (an object) to an array with the same data * - * @param $objOrArray Object|Array - * @param $recursive Bool - * @return Array + * @param object|array $objOrArray + * @param bool $recursive + * @return array */ function wfObjectToArray( $objOrArray, $recursive = true ) { $array = array(); @@ -296,7 +296,7 @@ function wfRandom() { * of token please use MWCryptRand instead. * * @param int $length The length of the string to generate - * @return String + * @return string * @since 1.20 */ function wfRandomString( $length = 32 ) { @@ -326,7 +326,7 @@ function wfRandomString( $length = 32 ) { * * %2F in the page titles seems to fatally break for some reason. * - * @param $s String: + * @param string $s * @return string */ function wfUrlencode( $s ) { @@ -363,8 +363,8 @@ function wfUrlencode( $s ) { * * @param array $array1 ( String|Array ) * @param array $array2 ( String|Array ) - * @param $prefix String - * @return String + * @param string $prefix + * @return string */ function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) { if ( !is_null( $array2 ) ) { @@ -408,7 +408,7 @@ function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) { * with legacy functions that accept raw query strings instead of nice * arrays. Of course, keys and values are urldecode()d. * - * @param string $query query string + * @param string $query Query string * @return string[] Array version of input */ function wfCgiToArray( $query ) { @@ -490,8 +490,8 @@ function wfAppendQuery( $url, $query ) { * @todo this won't work with current-path-relative URLs * like "subdir/foo.html", etc. * - * @param string $url either fully-qualified or a local path + query - * @param $defaultProto Mixed: one of the PROTO_* constants. Determines the + * @param string $url Either fully-qualified or a local path + query + * @param string $defaultProto One of the PROTO_* constants. Determines the * protocol to use if $url or $wgServer is protocol-relative * @return string Fully-qualified URL, current-path-relative URL or false if * no valid URL can be constructed @@ -692,7 +692,7 @@ function wfRemoveDotSegments( $urlPath ) { * * @param bool $includeProtocolRelative If false, remove '//' from the returned protocol list. * DO NOT USE this directly, use wfUrlProtocolsWithoutProtRel() instead - * @return String + * @return string */ function wfUrlProtocols( $includeProtocolRelative = true ) { global $wgUrlProtocols; @@ -737,7 +737,7 @@ function wfUrlProtocols( $includeProtocolRelative = true ) { * Like wfUrlProtocols(), but excludes '//' from the protocol list. Use this if * you need a regex that matches all URL protocols but does not match protocol- * relative URLs - * @return String + * @return string */ function wfUrlProtocolsWithoutProtRel() { return wfUrlProtocols( false ); @@ -751,7 +751,7 @@ function wfUrlProtocolsWithoutProtRel() { * protocol-relative URLs) correctly. * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2)). * - * @param string $url a URL to parse + * @param string $url A URL to parse * @return string[] Bits of the URL in an associative array, per PHP docs */ function wfParseUrl( $url ) { @@ -821,7 +821,7 @@ function wfParseUrl( $url ) { * * @todo handle punycode domains too * - * @param $url string + * @param string $url * @return string */ function wfExpandIRI( $url ) { @@ -844,7 +844,7 @@ function wfExpandIRI_callback( $matches ) { /** * Make URL indexes, appropriate for the el_index field of externallinks. * - * @param $url String + * @param string $url * @return array */ function wfMakeUrlIndexes( $url ) { @@ -924,7 +924,7 @@ function wfMatchesDomainList( $url, $domains ) { * $wgDebugRawPage - if false, 'action=raw' hits will not result in debug output. * $wgDebugComments - if on, some debug items may appear in comments in the HTML output. * - * @param $text String + * @param string $text * @param string|bool $dest Destination of the message: * - 'all': both to the log and HTML (debug toolbar or HTML comments) * - 'log': only to the log and not in HTML @@ -1007,7 +1007,7 @@ function wfDebugTimer() { /** * Send a line giving PHP memory usage. * - * @param bool $exact print exact values instead of kilobytes (default: false) + * @param bool $exact Print exact values instead of kilobytes (default: false) */ function wfDebugMem( $exact = false ) { $mem = memory_get_usage(); @@ -1084,7 +1084,7 @@ function wfDebugLog( $logGroup, $text, $dest = 'all' ) { /** * Log for database errors * - * @param string $text database error message. + * @param string $text Database error message. */ function wfLogDBError( $text ) { global $wgDBerrorLog, $wgDBerrorLogTZ; @@ -1116,11 +1116,11 @@ function wfLogDBError( $text ) { /** * Throws a warning that $function is deprecated * - * @param $function String + * @param string $function * @param string|bool $version Version of MediaWiki that the function * was deprecated in (Added in 1.19). * @param string|bool $component Added in 1.19. - * @param $callerOffset integer: How far up the call stack is the original + * @param int $callerOffset How far up the call stack is the original * caller. 2 = function that called the function that called * wfDeprecated (Added in 1.20) * @@ -1135,9 +1135,9 @@ function wfDeprecated( $function, $version = false, $component = false, $callerO * $wgDevelopmentWarnings. To log warnings in production, use wfLogWarning() instead. * * @param string $msg message to send - * @param $callerOffset Integer: number of items to go back in the backtrace to + * @param int $callerOffset Number of items to go back in the backtrace to * find the correct caller (1 = function calling wfWarn, ...) - * @param $level Integer: PHP error level; defaults to E_USER_NOTICE; + * @param int $level PHP error level; defaults to E_USER_NOTICE; * only used when $wgDevelopmentWarnings is true */ function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) { @@ -1148,10 +1148,10 @@ function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) { * Send a warning as a PHP error and the debug log. This is intended for logging * warnings in production. For logging development warnings, use WfWarn instead. * - * @param $msg String: message to send - * @param $callerOffset Integer: number of items to go back in the backtrace to + * @param string $msg Message to send + * @param int $callerOffset Number of items to go back in the backtrace to * find the correct caller (1 = function calling wfLogWarning, ...) - * @param $level Integer: PHP error level; defaults to E_USER_WARNING + * @param int $level PHP error level; defaults to E_USER_WARNING */ function wfLogWarning( $msg, $callerOffset = 1, $level = E_USER_WARNING ) { MWDebug::warning( $msg, $callerOffset + 1, $level, 'production' ); @@ -1163,8 +1163,8 @@ function wfLogWarning( $msg, $callerOffset = 1, $level = E_USER_WARNING ) { * Can also log to TCP or UDP with the syntax udp://host:port/prefix. This will * send lines to the specified port, prefixed by the specified prefix and a space. * - * @param $text String - * @param string $file filename + * @param string $text + * @param string $file Filename * @throws MWException */ function wfErrorLog( $text, $file ) { @@ -1299,8 +1299,8 @@ function wfLogProfilingData() { /** * Increment a statistics counter * - * @param $key String - * @param $count Int + * @param string $key + * @param int $count * @return void */ function wfIncrStats( $key, $count = 1 ) { @@ -1319,7 +1319,7 @@ function wfReadOnly() { /** * Get the value of $wgReadOnly or the contents of $wgReadOnlyFile. * - * @return string|bool: String when in read-only mode; false otherwise + * @return string|bool String when in read-only mode; false otherwise */ function wfReadOnlyReason() { global $wgReadOnly, $wgReadOnlyFile; @@ -1339,7 +1339,7 @@ function wfReadOnlyReason() { /** * Return a Language object from $langcode * - * @param $langcode Mixed: either: + * @param Language|string|bool $langcode Either: * - a Language object * - code of the language to get the message for, if it is * a valid code create a language for that language, if @@ -1349,7 +1349,7 @@ function wfReadOnlyReason() { * the current user's language (as a fallback for the old parameter * functionality), or if it is true then use global object * for the wiki's content language. - * @return Language object + * @return Language */ function wfGetLangObj( $langcode = false ) { # Identify which language to get or create a language object for. @@ -1443,7 +1443,7 @@ function wfMessageFallback( /*...*/ ) { * - As an array in the second parameter * These are not shown in the function definition. * - * @return String + * @return string */ function wfMsg( $key ) { wfDeprecated( __METHOD__, '1.21' ); @@ -1458,8 +1458,8 @@ function wfMsg( $key ) { * * @deprecated since 1.18 * - * @param $key String - * @return String + * @param string $key + * @return string */ function wfMsgNoTrans( $key ) { wfDeprecated( __METHOD__, '1.21' ); @@ -1490,9 +1490,9 @@ function wfMsgNoTrans( $key ) { * * @deprecated since 1.18 * - * @param string $key lookup key for the message, usually + * @param string $key Lookup key for the message, usually * defined in languages/Language.php - * @return String + * @return string */ function wfMsgForContent( $key ) { wfDeprecated( __METHOD__, '1.21' ); @@ -1514,8 +1514,8 @@ function wfMsgForContent( $key ) { * * @deprecated since 1.18 * - * @param $key String - * @return String + * @param string $key + * @return string */ function wfMsgForContentNoTrans( $key ) { wfDeprecated( __METHOD__, '1.21' ); @@ -1537,7 +1537,7 @@ function wfMsgForContentNoTrans( $key ) { * * @deprecated since 1.18 * - * @param string $key key to get. + * @param string $key Key to get. * @param array $args * @param bool $useDB * @param string|bool $forContent Language code, or false for user lang, true for content lang. @@ -1562,7 +1562,7 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform * @param string $key * @param bool $useDB * @param string|bool $langCode Code of the language to get the message for, or - * behaves as a content language switch if it is a boolean. + * behaves as a content language switch if it is a boolean. * @param bool $transform Whether to parse magic words, etc. * @return string */ @@ -1659,8 +1659,8 @@ function wfMsgWikiHtml( $key ) { * * @deprecated since 1.18 * - * @param string $key key of the message - * @param array $options processing rules. + * @param string $key Key of the message + * @param array $options Processing rules. * Can take the following options: * parse: parses wikitext to HTML * parseinline: parses wikitext to HTML and removes the surrounding @@ -1675,7 +1675,7 @@ function wfMsgWikiHtml( $key ) { * (overridden by content). * Behavior for conflicting options (e.g., parse+parseinline) is undefined. * - * @return String + * @return string */ function wfMsgExt( $key, $options ) { wfDeprecated( __METHOD__, '1.21' ); @@ -1770,7 +1770,7 @@ function wfEmptyMsg( $key ) { * but now throws an exception instead, with similar results. * * @deprecated since 1.22; just throw an MWException yourself - * @param string $msg message shown when dying. + * @param string $msg Message shown when dying. * @throws MWException */ function wfDebugDieBacktrace( $msg = '' ) { @@ -1849,7 +1849,7 @@ function wfReportTime() { * * @param int $limit This parameter can be used to limit the number of stack frames returned * - * @return array of backtrace information + * @return array Array of backtrace information */ function wfDebugBacktrace( $limit = 0 ) { static $disabled = null; @@ -1937,7 +1937,7 @@ function wfBacktrace() { * wfGetCaller( 2 ) [default] is the caller of the function running wfGetCaller() * wfGetCaller( 3 ) is the parent of that. * - * @param $level Int + * @param int $level * @return string */ function wfGetCaller( $level = 2 ) { @@ -1953,9 +1953,8 @@ function wfGetCaller( $level = 2 ) { * Return a string consisting of callers in the stack. Useful sometimes * for profiling specific points. * - * @param int $limit The maximum depth of the stack frame to return, or false for - * the entire stack. - * @return String + * @param int $limit The maximum depth of the stack frame to return, or false for the entire stack. + * @return string */ function wfGetAllCallers( $limit = 3 ) { $trace = array_reverse( wfDebugBacktrace() ); @@ -1969,7 +1968,7 @@ function wfGetAllCallers( $limit = 3 ) { /** * Return a string representation of frame * - * @param $frame Array + * @param array $frame * @return string */ function wfFormatStackFrame( $frame ) { @@ -1997,8 +1996,8 @@ function wfShowingResults( $offset, $limit ) { * @param string $offset * @param int $limit * @param string $link - * @param string $query optional URL query parameter string - * @param bool $atend optional param for specified if this is the last page + * @param string $query Optional URL query parameter string + * @param bool $atend Optional param for specified if this is the last page * @return string * @deprecated since 1.19; use Language::viewPrevNext() instead */ @@ -2057,10 +2056,9 @@ function wfClientAcceptsGzip( $force = false ) { * Obtain the offset and limit values from the request string; * used in special pages * - * @param int $deflimit default limit if none supplied + * @param int $deflimit Default limit if none supplied * @param string $optionname Name of a user preference to check against * @return array - * */ function wfCheckLimits( $deflimit = 50, $optionname = 'rclimit' ) { global $wgRequest; @@ -2073,8 +2071,8 @@ function wfCheckLimits( $deflimit = 50, $optionname = 'rclimit' ) { * is achieved by substituting certain characters with HTML entities. * As required by the callers, "" is not used. * - * @param string $text text to be escaped - * @return String + * @param string $text Text to be escaped + * @return string */ function wfEscapeWikiText( $text ) { static $repl = null, $repl2 = null; @@ -2121,7 +2119,7 @@ function wfEscapeWikiText( $text ) { /** * Get the current unix timestamp with microseconds. Useful for profiling * @deprecated since 1.22; call microtime() directly - * @return Float + * @return float */ function wfTime() { wfDeprecated( __FUNCTION__, '1.22' ); @@ -2133,10 +2131,10 @@ function wfTime() { * If source is NULL, it just returns the value, it doesn't set the variable * If force is true, it will set the value even if source is NULL * - * @param $dest Mixed - * @param $source Mixed - * @param $force Bool - * @return Mixed + * @param mixed $dest + * @param mixed $source + * @param bool $force + * @return mixed */ function wfSetVar( &$dest, $source, $force = false ) { $temp = $dest; @@ -2149,9 +2147,9 @@ function wfSetVar( &$dest, $source, $force = false ) { /** * As for wfSetVar except setting a bit * - * @param $dest Int - * @param $bit Int - * @param $state Bool + * @param int $dest + * @param int $bit + * @param bool $state * * @return bool */ @@ -2171,7 +2169,7 @@ function wfSetBit( &$dest, $bit, $state = true ) { * A wrapper around the PHP function var_export(). * Either print it or add it to the regular output ($wgOut). * - * @param $var mixed A PHP variable to dump. + * @param mixed $var A PHP variable to dump. */ function wfVarDump( $var ) { global $wgOut; @@ -2186,9 +2184,9 @@ function wfVarDump( $var ) { /** * Provide a simple HTTP error. * - * @param $code Int|String - * @param $label String - * @param $desc String + * @param int|string $code + * @param string $label + * @param string $desc */ function wfHttpError( $code, $label, $desc ) { global $wgOut; @@ -2223,7 +2221,7 @@ function wfHttpError( $code, $label, $desc ) { * Note that some PHP configuration options may add output buffer * layers which cannot be removed; these are left in place. * - * @param $resetGzipEncoding Bool + * @param bool $resetGzipEncoding */ function wfResetOutputBuffers( $resetGzipEncoding = true ) { if ( $resetGzipEncoding ) { @@ -2338,8 +2336,8 @@ function mimeTypeMatch( $type, $avail ) { * array of type to preference (preference is a float between 0.0 and 1.0). * Wildcards in the types are acceptable. * - * @param array $cprefs client's acceptable type list - * @param array $sprefs server's offered types + * @param array $cprefs Client's acceptable type list + * @param array $sprefs Server's offered types * @return string * * @todo FIXME: Doesn't handle params like 'text/plain; charset=UTF-8' @@ -2384,7 +2382,7 @@ function wfNegotiateType( $cprefs, $sprefs ) { /** * Reference-counted warning suppression * - * @param $end Bool + * @param bool $end */ function wfSuppressWarnings( $end = false ) { static $suppressCount = 0; @@ -2476,11 +2474,10 @@ define( 'TS_ISO_8601_BASIC', 9 ); /** * Get a timestamp string in one of various formats * - * @param $outputtype Mixed: A timestamp in one of the supported formats, the - * function will autodetect which format is supplied and act - * accordingly. - * @param $ts Mixed: optional timestamp to convert, default 0 for the current time - * @return Mixed: String / false The same date in the format specified in $outputtype or false + * @param mixed $outputtype A timestamp in one of the supported formats, the + * function will autodetect which format is supplied and act accordingly. + * @param mixed $ts Optional timestamp to convert, default 0 for the current time + * @return string|bool String / false The same date in the format specified in $outputtype or false */ function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) { try { @@ -2583,9 +2580,9 @@ function wfTempDir() { /** * Make directory, and make all parent directories if they don't exist * - * @param string $dir full path to directory to create + * @param string $dir Full path to directory to create * @param int $mode Chmod value to use, default is $wgDirectoryMode - * @param string $caller optional caller param for debugging. + * @param string $caller Optional caller param for debugging. * @throws MWException * @return bool */ @@ -2630,6 +2627,7 @@ function wfMkdirParents( $dir, $mode = null, $caller = null ) { /** * Remove a directory and all its content. * Does not hide error. + * @param string $dir */ function wfRecursiveRemoveDir( $dir ) { wfDebug( __FUNCTION__ . "( $dir )\n" ); @@ -2651,7 +2649,7 @@ function wfRecursiveRemoveDir( $dir ) { } /** - * @param number $nr The number to format + * @param int $nr The number to format * @param int $acc The number of digits after the decimal point, default 2 * @param bool $round Whether or not to round the value, default true * @return string @@ -2790,18 +2788,18 @@ function wfShellExecDisabled() { * configuration if supported. * * @param string $cmd Command line, properly escaped for shell. - * @param &$retval null|Mixed optional, will receive the program's exit code. - * (non-zero is usually failure). If there is an error from - * read, select, or proc_open(), this will be set to -1. - * @param array $environ optional environment variables which should be - * added to the executed command environment. - * @param array $limits optional array with limits(filesize, memory, time, walltime) - * this overwrites the global wgMaxShell* limits. + * @param null|mixed &$retval Optional, will receive the program's exit code. + * (non-zero is usually failure). If there is an error from + * read, select, or proc_open(), this will be set to -1. + * @param array $environ Optional environment variables which should be + * added to the executed command environment. + * @param array $limits Optional array with limits(filesize, memory, time, walltime) + * this overwrites the global wgMaxShell* limits. * @param array $options Array of options: - * - duplicateStderr: Set this to true to duplicate stderr to stdout, - * including errors from limit.sh + * - duplicateStderr: Set this to true to duplicate stderr to stdout, + * including errors from limit.sh * - * @return string collected stdout as a string + * @return string Collected stdout as a string */ function wfShellExec( $cmd, &$retval = null, $environ = array(), $limits = array(), $options = array() @@ -3011,13 +3009,13 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(), * * @note This also includes errors from limit.sh, e.g. if $wgMaxShellFileSize is exceeded. * @param string $cmd Command line, properly escaped for shell. - * @param &$retval null|Mixed optional, will receive the program's exit code. - * (non-zero is usually failure) + * @param null|mixed &$retval Optional, will receive the program's exit code. + * (non-zero is usually failure) * @param array $environ optional environment variables which should be - * added to the executed command environment. - * @param array $limits optional array with limits(filesize, memory, time, walltime) - * this overwrites the global wgShellMax* limits. - * @return string collected stdout and stderr as a string + * added to the executed command environment. + * @param array $limits Optional array with limits(filesize, memory, time, walltime) + * this overwrites the global wgShellMax* limits. + * @return string Collected stdout and stderr as a string */ function wfShellExecWithStderr( $cmd, &$retval = null, $environ = array(), $limits = array() ) { return wfShellExec( $cmd, $retval, $environ, $limits, array( 'duplicateStderr' => true ) ); @@ -3158,9 +3156,9 @@ function wfMerge( $old, $mine, $yours, &$result ) { * Returns unified plain-text diff of two texts. * Useful for machine processing of diffs. * - * @param string $before the text before the changes. - * @param string $after the text after the changes. - * @param string $params command-line options for the diff command. + * @param string $before The text before the changes. + * @param string $after The text after the changes. + * @param string $params Command-line options for the diff command. * @return string Unified diff of $before and $after */ function wfDiff( $before, $after, $params = '-u' ) { @@ -3238,8 +3236,7 @@ function wfDiff( $before, $after, $params = '-u' ) { * * @see perldoc -f use * - * @param string|number $req_ver The version to check, can be a string, an integer, or - * a float + * @param string|int|float $req_ver The version to check, can be a string, an integer, or a float * @throws MWException */ function wfUsePHP( $req_ver ) { @@ -3268,8 +3265,7 @@ function wfUsePHP( $req_ver ) { * * @see perldoc -f use * - * @param string|number $req_ver The version to check, can be a string, an integer, or - * a float + * @param string|int|float $req_ver The version to check, can be a string, an integer, or a float * @throws MWException */ function wfUseMW( $req_ver ) { @@ -3289,7 +3285,7 @@ function wfUseMW( $req_ver ) { * We'll consider it so always, as we don't want '\s' in our Unix paths either. * * @param string $path - * @param string $suffix to remove if present + * @param string $suffix String to remove if present * @return string */ function wfBaseName( $path, $suffix = '' ) { @@ -3312,7 +3308,7 @@ function wfBaseName( $path, $suffix = '' ) { * May explode on non-matching case-insensitive paths, * funky symlinks, etc. * - * @param string $path absolute destination path including target filename + * @param string $path Absolute destination path including target filename * @param string $from Absolute source path, directory only * @return string */ @@ -3690,7 +3686,7 @@ function &wfGetLBFactory() { * * bypassCache: If true, do not use the process-local cache of File objects * - * @return File, or false if the file does not exist + * @return File|bool File, or false if the file does not exist */ function wfFindFile( $title, $options = array() ) { return RepoGroup::singleton()->findFile( $title, $options ); @@ -3726,7 +3722,7 @@ function wfQueriesMustScale() { * extensions; this is a wrapper around $wgScriptExtension etc. * except for 'index' and 'load' which use $wgScript/$wgLoadScript * - * @param string $script script filename, sans extension + * @param string $script Script filename, sans extension * @return string */ function wfScript( $script = 'index' ) { @@ -3944,7 +3940,7 @@ function wfBCP47( $code ) { /** * Get a cache object. * - * @param $inputType integer Cache type, one the the CACHE_* constants. + * @param int $inputType Cache type, one the the CACHE_* constants. * @return BagOStuff */ function wfGetCache( $inputType ) { @@ -3994,9 +3990,9 @@ function wfGetLangConverterCacheStorage() { /** * Call hook functions defined in $wgHooks * - * @param string $event event name - * @param array $args parameters passed to hook functions - * @param string|null $deprecatedVersion optionally mark hook as deprecated with version number + * @param string $event Event name + * @param array $args Parameters passed to hook functions + * @param string|null $deprecatedVersion Optionally mark hook as deprecated with version number * * @return bool True if no handler aborted the hook */ @@ -4049,9 +4045,9 @@ function wfUnpack( $format, $data, $length = false ) { * * Any subsequent links on the same line are considered to be exceptions, * i.e. articles where the image may occur inline. * - * @param string $name the image name to check + * @param string $name The image name to check * @param Title|bool $contextTitle The page on which the image occurs, if known - * @param string $blacklist wikitext of a file blacklist + * @param string $blacklist Wikitext of a file blacklist * @return bool */ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) { @@ -4126,7 +4122,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) { * access the wiki via HTTPS. * * @param string $ip The IPv4/6 address in the normal human-readable form - * @return boolean + * @return bool */ function wfCanIPUseHTTPS( $ip ) { $canDo = true; diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index a3ed7009e5..da54673df5 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -32,18 +32,18 @@ interface HistoryBlob * You must call setLocation() on the stub object before storing it to the * database * - * @param $text string + * @param string $text * - * @return String: the key for getItem() + * @return string The key for getItem() */ function addItem( $text ); /** * Get item by key, or false if the key is not present * - * @param $key string + * @param string $key * - * @return String or false + * @return string|bool */ function getItem( $key ); @@ -55,14 +55,14 @@ interface HistoryBlob * * Default text is not required for two-part external storage URLs. * - * @param $text string + * @param string $text */ function setText( $text ); /** * Get default text. This is called from Revision::getRevisionText() * - * @return String + * @return string */ function getText(); } @@ -88,7 +88,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob } /** - * @param $text string + * @param string $text * @return string */ public function addItem( $text ) { @@ -102,7 +102,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob } /** - * @param $hash string + * @param string $hash * @return array|bool */ public function getItem( $hash ) { @@ -115,7 +115,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob } /** - * @param $text string + * @param string $text * @return void */ public function setText( $text ) { @@ -134,7 +134,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob /** * Remove an item * - * @param $hash string + * @param string $hash */ public function removeItem( $hash ) { $this->mSize -= strlen( $this->mItems[$hash] ); @@ -200,8 +200,8 @@ class HistoryBlobStub { var $mOldId, $mHash, $mRef; /** - * @param string $hash the content hash of the text - * @param $oldid Integer the old_id for the CGZ object + * @param string $hash The content hash of the text + * @param int $oldid The old_id for the CGZ object */ function __construct( $hash = '', $oldid = 0 ) { $this->mHash = $hash; @@ -210,6 +210,7 @@ class HistoryBlobStub { /** * Sets the location (old_id) of the main object to which this object * points + * @param int $id */ function setLocation( $id ) { $this->mOldId = $id; @@ -217,6 +218,7 @@ class HistoryBlobStub { /** * Sets the location (old_id) of the referring object + * @param string $id */ function setReferrer( $id ) { $this->mRef = $id; @@ -224,6 +226,7 @@ class HistoryBlobStub { /** * Gets the location of the referring object + * @return string */ function getReferrer() { return $this->mRef; @@ -298,7 +301,7 @@ class HistoryBlobCurStub { var $mCurId; /** - * @param $curid Integer: the cur_id pointed to + * @param int $curid The cur_id pointed to */ function __construct( $curid = 0 ) { $this->mCurId = $curid; @@ -308,7 +311,7 @@ class HistoryBlobCurStub { * Sets the location (cur_id) of the main object to which this object * points * - * @param $id int + * @param int $id */ function setLocation( $id ) { $this->mCurId = $id; @@ -390,7 +393,7 @@ class DiffHistoryBlob implements HistoryBlob { /** * @throws MWException - * @param $text string + * @param string $text * @return int */ function addItem( $text ) { @@ -405,7 +408,7 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $key string + * @param string $key * @return string */ function getItem( $key ) { @@ -413,7 +416,7 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $text string + * @param string $text */ function setText( $text ) { $this->mDefaultKey = $this->addItem( $text ); @@ -502,8 +505,8 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $t1 - * @param $t2 + * @param string $t1 + * @param string $t2 * @return string */ function diff( $t1, $t2 ) { @@ -516,8 +519,8 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $base - * @param $diff + * @param string $base + * @param string $diff * @return bool|string */ function patch( $base, $diff ) { @@ -580,7 +583,7 @@ class DiffHistoryBlob implements HistoryBlob { * the bytes backwards and initialised with 0 instead of 1. See bug 34428. * * @param string $s - * @return string|bool: false if the hash extension is not available + * @return string|bool false if the hash extension is not available */ function xdiffAdler32( $s ) { if ( !function_exists( 'hash' ) ) { diff --git a/includes/Html.php b/includes/Html.php index b1d4f001af..2a8c9b1736 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -139,9 +139,9 @@ class Html { * Identical to rawElement(), but HTML-escapes $contents (like * Xml::element()). * - * @param $element string - * @param $attribs array - * @param $contents string + * @param string $element + * @param array $attribs + * @param string $contents * * @return string */ @@ -158,8 +158,8 @@ class Html { * Identical to rawElement(), but has no third parameter and omits the end * tag (and the self-closing '/' in XML mode for empty elements). * - * @param $element string - * @param $attribs array + * @param string $element + * @param array $attribs * * @return string */ @@ -267,7 +267,7 @@ class Html { * to the input array (currently per the HTML 5 draft as of 2009-09-06). * * @param string $element Name of the element, e.g., 'a' - * @param array $attribs Associative array of attributes, e.g., array( + * @param array $attribs Associative array of attributes, e.g., array( * 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for * further documentation. * @return array An array of attributes functionally identical to $attribs @@ -583,7 +583,7 @@ class Html { * Output a "". * - * @param $url string + * @param string $url * @return string Raw HTML */ public static function linkedScript( $url ) { @@ -598,7 +598,7 @@ class Html { * contains literal "" (admittedly unlikely). * * @param string $contents CSS - * @param $media mixed A media type string, like 'screen' + * @param string $media A media type string, like 'screen' * @return string Raw HTML */ public static function inlineStyle( $contents, $media = 'all' ) { @@ -618,8 +618,8 @@ class Html { * Output a "" linking to the given URL for the given * media type (if any). * - * @param $url string - * @param $media mixed A media type string, like 'screen' + * @param string $url + * @param string $media A media type string, like 'screen' * @return string Raw HTML */ public static function linkedStyle( $url, $media = 'all' ) { @@ -854,11 +854,11 @@ class Html { /** * Get HTML for an info box with an icon. * - * @param string $text wikitext, get this with wfMessage()->plain() - * @param string $icon icon name, file in skins/common/images - * @param string $alt alternate text for the icon - * @param string $class additional class name to add to the wrapper div - * @param $useStylePath + * @param string $text Wikitext, get this with wfMessage()->plain() + * @param string $icon Icon name, file in skins/common/images + * @param string $alt Alternate text for the icon + * @param string $class Additional class name to add to the wrapper div + * @param bool $useStylePath * * @return string */ diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 1fd437ed1d..c9dd0c067f 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -55,7 +55,7 @@ class Http { * to avoid attacks on intranet services accessible by HTTP. * - userAgent A user agent, if you want to override the default * MediaWiki/$wgVersion - * @return Mixed: (bool)false on failure or a string on success + * @return string|bool (bool)false on failure or a string on success */ public static function request( $method, $url, $options = array() ) { wfDebug( "HTTP: $method: $url\n" ); @@ -85,9 +85,9 @@ class Http { * Simple wrapper for Http::request( 'GET' ) * @see Http::request() * - * @param $url - * @param $timeout string - * @param $options array + * @param string $url + * @param string $timeout + * @param array $options * @return string */ public static function get( $url, $timeout = 'default', $options = array() ) { @@ -99,8 +99,8 @@ class Http { * Simple wrapper for Http::request( 'POST' ) * @see Http::request() * - * @param $url - * @param $options array + * @param string $url + * @param array $options * @return string */ public static function post( $url, $options = array() ) { @@ -110,8 +110,8 @@ class Http { /** * Check if the URL can be served by localhost * - * @param string $url full url to check - * @return Boolean + * @param string $url Full url to check + * @return bool */ public static function isLocalURL( $url ) { global $wgCommandLineMode, $wgConf; @@ -150,7 +150,7 @@ class Http { /** * A standard user-agent we can use for external requests. - * @return String + * @return string */ public static function userAgent() { global $wgVersion; @@ -166,8 +166,8 @@ class Http { * * @todo FIXME this is wildly inaccurate and fails to actually check most stuff * - * @param $uri Mixed: URI to check for validity - * @return Boolean + * @param string $uri URI to check for validity + * @return bool */ public static function isValidURI( $uri ) { return preg_match( @@ -217,7 +217,7 @@ class MWHttpRequest { public $status; /** - * @param string $url url to use. If protocol-relative, will be expanded to an http:// URL + * @param string $url Url to use. If protocol-relative, will be expanded to an http:// URL * @param array $options (optional) extra params to pass (see Http::request()) */ protected function __construct( $url, $options = array() ) { @@ -276,7 +276,7 @@ class MWHttpRequest { /** * Generate a new request object - * @param string $url url to use + * @param string $url Url to use * @param array $options (optional) extra params to pass (see Http::request()) * @throws MWException * @return CurlHttpRequest|PhpHttpRequest @@ -310,7 +310,7 @@ class MWHttpRequest { /** * Get the body, or content, of the response to the request * - * @return String + * @return string */ public function getContent() { return $this->content; @@ -319,7 +319,7 @@ class MWHttpRequest { /** * Set the parameters of the request * - * @param $args Array + * @param array $args * @todo overload the args param */ public function setData( $args ) { @@ -352,7 +352,7 @@ class MWHttpRequest { /** * Set the user agent - * @param $UA string + * @param string $UA */ public function setUserAgent( $UA ) { $this->setHeader( 'User-Agent', $UA ); @@ -360,8 +360,8 @@ class MWHttpRequest { /** * Set an arbitrary header - * @param $name - * @param $value + * @param string $name + * @param string $value */ public function setHeader( $name, $value ) { // I feel like I should normalize the case here... @@ -405,7 +405,7 @@ class MWHttpRequest { * bytes are reported handled than were passed to you, the HTTP fetch * will be aborted. * - * @param $callback Callback + * @param callable $callback * @throws MWException */ public function setCallback( $callback ) { @@ -419,8 +419,8 @@ class MWHttpRequest { * A generic callback to read the body of the response from a remote * server. * - * @param $fh handle - * @param $content String + * @param resource $fh + * @param string $content * @return int */ public function read( $fh, $content ) { @@ -507,7 +507,7 @@ class MWHttpRequest { * (see RFC2616, section 10, http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html * for a list of status codes.) * - * @return Integer + * @return int */ public function getStatus() { if ( !$this->respHeaders ) { @@ -520,7 +520,7 @@ class MWHttpRequest { /** * Returns true if the last status code was a redirect. * - * @return Boolean + * @return bool */ public function isRedirect() { if ( !$this->respHeaders ) { @@ -542,7 +542,7 @@ class MWHttpRequest { * (e.g. Set-Cookie) can appear more than once the, each value of * the associative array is an array of the values given. * - * @return Array + * @return array */ public function getResponseHeaders() { if ( !$this->respHeaders ) { @@ -555,8 +555,8 @@ class MWHttpRequest { /** * Returns the value of the given response header. * - * @param $header String - * @return String + * @param string $header + * @return string */ public function getResponseHeader( $header ) { if ( !$this->respHeaders ) { @@ -574,7 +574,7 @@ class MWHttpRequest { /** * Tells the MWHttpRequest object to use this pre-loaded CookieJar. * - * @param $jar CookieJar + * @param CookieJar $jar */ public function setCookieJar( $jar ) { $this->cookieJar = $jar; @@ -598,9 +598,9 @@ class MWHttpRequest { * cookies. Used internally after a request to parse the * Set-Cookie headers. * @see Cookie::set - * @param $name - * @param $value null - * @param $attr null + * @param string $name + * @param mixed $value + * @param array $attr */ public function setCookie( $name, $value = null, $attr = null ) { if ( !$this->cookieJar ) { @@ -705,8 +705,8 @@ class CurlHttpRequest extends MWHttpRequest { protected $headerText = ""; /** - * @param $fh - * @param $content + * @param resource $fh + * @param string $content * @return int */ protected function readHeader( $fh, $content ) { @@ -821,7 +821,7 @@ class CurlHttpRequest extends MWHttpRequest { class PhpHttpRequest extends MWHttpRequest { /** - * @param $url string + * @param string $url * @return string */ protected function urlToTcp( $url ) { diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a83217d5a2..8444223a50 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -40,7 +40,7 @@ class ImagePage extends Article { var $mExtraDescription = false; /** - * @param $title Title + * @param Title $title * @return WikiFilePage */ protected function newPage( Title $title ) { @@ -50,7 +50,7 @@ class ImagePage extends Article { /** * Constructor from a page id - * @param int $id article ID to load + * @param int $id Article ID to load * @return ImagePage|null */ public static function newFromID( $id ) { @@ -61,7 +61,7 @@ class ImagePage extends Article { } /** - * @param $file File: + * @param File $file * @return void */ public function setFile( $file ) { @@ -227,8 +227,8 @@ class ImagePage extends Article { /** * Create the TOC * - * @param $metadata Boolean: whether or not to show the metadata link - * @return String + * @param bool $metadata Whether or not to show the metadata link + * @return string */ protected function showTOC( $metadata ) { $r = array( @@ -250,8 +250,8 @@ class ImagePage extends Article { * * @todo FIXME: Bad interface, see note on MediaHandler::formatMetadata(). * - * @param array $metadata the array containing the Exif data - * @return String The metadata table. This is treated as Wikitext (!) + * @param array $metadata The array containing the Exif data + * @return string The metadata table. This is treated as Wikitext (!) */ protected function makeMetadataTable( $metadata ) { $r = "