From 0aa24ae558decd6e7e48884228ffaa69cb90abf2 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sun, 10 Mar 2013 23:45:51 -0400 Subject: [PATCH] Fixed many small spelling mistakes and php docs, var decl. Change-Id: I1508ed7eb77e5e4f700fb63955d626c4f5915840 --- includes/api/ApiBase.php | 10 +++++----- includes/api/ApiEditPage.php | 6 ++++-- includes/api/ApiFormatJson.php | 2 +- includes/api/ApiLogin.php | 2 +- includes/api/ApiParamInfo.php | 4 ++-- includes/api/ApiProtect.php | 2 +- includes/api/ApiQuery.php | 2 ++ includes/api/ApiQueryAllImages.php | 2 +- includes/api/ApiQueryAllPages.php | 2 +- includes/api/ApiQueryBacklinks.php | 2 ++ includes/api/ApiQueryCategoryInfo.php | 1 + includes/api/ApiQueryDuplicateFiles.php | 2 ++ includes/api/ApiQueryImageInfo.php | 6 +++++- includes/api/ApiQueryInfo.php | 3 +++ includes/api/ApiQueryLangLinks.php | 2 +- includes/api/ApiQueryLogEvents.php | 2 +- includes/api/ApiQueryQueryPage.php | 2 ++ includes/api/ApiQueryRandom.php | 2 ++ includes/api/ApiQueryRecentChanges.php | 2 +- includes/api/ApiQueryRevisions.php | 1 + includes/api/ApiQueryUserContributions.php | 2 +- includes/api/ApiQueryWatchlist.php | 2 +- includes/api/ApiResult.php | 4 ++-- includes/api/ApiSetNotificationTimestamp.php | 7 ++++--- includes/api/ApiUpload.php | 10 +++++++--- 25 files changed, 54 insertions(+), 28 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index b82aadf80c..f953bb1c9c 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -189,7 +189,7 @@ abstract class ApiBase extends ContextSource { * @return ApiResult */ public function getResult() { - // Main module has getResult() method overriden + // Main module has getResult() method overridden // Safety - avoid infinite loop: if ( $this->isMain() ) { ApiBase::dieDebug( __METHOD__, 'base method was called on main module. ' ); @@ -582,7 +582,7 @@ abstract class ApiBase extends ContextSource { * The array can also contain a boolean under the key PROP_LIST, * indicating whether the result is a list. * - * Don't call this functon directly: use getFinalResultProperties() to + * Don't call this function directly: use getFinalResultProperties() to * allow hooks to modify descriptions as needed. * * @return array|bool False on no properties @@ -795,7 +795,7 @@ abstract class ApiBase extends ContextSource { } /** - * Callback function used in requireOnlyOneParameter to check whether reequired parameters are set + * Callback function used in requireOnlyOneParameter to check whether required parameters are set * * @param $x object Parameter to check is not null/false * @return bool @@ -838,7 +838,7 @@ abstract class ApiBase extends ContextSource { if ( $userWatching ) { return true; } - # If no user option was passed, use watchdefault or watchcreation + # If no user option was passed, use watchdefault or watchcreations if ( is_null( $userOption ) ) { $userOption = $titleObj->exists() ? 'watchdefault' : 'watchcreations'; @@ -1268,7 +1268,7 @@ abstract class ApiBase extends ContextSource { 'badipaddress' => array( 'code' => 'invalidip', 'info' => "Invalid IP address specified" ), 'ipb_expiry_invalid' => array( 'code' => 'invalidexpiry', 'info' => "Invalid expiry time" ), 'ipb_already_blocked' => array( 'code' => 'alreadyblocked', 'info' => "The user you tried to block was already blocked" ), - 'ipb_blocked_as_range' => array( 'code' => 'blockedasrange', 'info' => "IP address \"\$1\" was blocked as part of range \"\$2\". You can't unblock the IP invidually, but you can unblock the range as a whole." ), + 'ipb_blocked_as_range' => array( 'code' => 'blockedasrange', 'info' => "IP address \"\$1\" was blocked as part of range \"\$2\". You can't unblock the IP individually, but you can unblock the range as a whole." ), 'ipb_cant_unblock' => array( 'code' => 'cantunblock', 'info' => "The block you specified was not found. It may have been unblocked already" ), 'mailnologin' => array( 'code' => 'cantsend', 'info' => "You are not logged in, you do not have a confirmed email address, or you are not allowed to send email to other users, so you cannot send email" ), 'ipbblocked' => array( 'code' => 'ipbblocked', 'info' => 'You cannot block or unblock users while you are yourself blocked' ), diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index dc449b88b0..cba3489a91 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -58,6 +58,8 @@ class ApiEditPage extends ApiBase { // array_shift( $titles ); $redirValues = array(); + + /** @var $newTitle Title */ foreach ( $titles as $id => $newTitle ) { if ( !isset( $titles[$id - 1] ) ) { @@ -304,6 +306,7 @@ class ApiEditPage extends ApiBase { $articleContext->setWikiPage( $pageObj ); $articleContext->setUser( $this->getUser() ); + /** @var $articleObject Article */ $articleObject = Article::newFromWikiPage( $pageObj, $articleContext ); $ep = new EditPage( $articleObject ); @@ -393,6 +396,7 @@ class ApiEditPage extends ApiBase { case EditPage::AS_SUCCESS_NEW_ARTICLE: $r['new'] = ''; + // fall-through case EditPage::AS_SUCCESS_UPDATE: $r['result'] = 'Success'; @@ -632,10 +636,8 @@ class ApiEditPage extends ApiBase { public function getExamples() { return array( - 'api.php?action=edit&title=Test&summary=test%20summary&text=article%20content&basetimestamp=20070824123454&token=%2B\\' => 'Edit a page (anonymous user)', - 'api.php?action=edit&title=Test&summary=NOTOC&minor=&prependtext=__NOTOC__%0A&basetimestamp=20070824123454&token=%2B\\' => 'Prepend __NOTOC__ to a page (anonymous user)', 'api.php?action=edit&title=Test&undo=13585&undoafter=13579&basetimestamp=20070824123454&token=%2B\\' diff --git a/includes/api/ApiFormatJson.php b/includes/api/ApiFormatJson.php index 19c5e5f085..abb63480af 100644 --- a/includes/api/ApiFormatJson.php +++ b/includes/api/ApiFormatJson.php @@ -85,7 +85,7 @@ class ApiFormatJson extends ApiFormatBase { public function getDescription() { if ( $this->mIsRaw ) { - return 'Output data with the debuging elements in JSON format' . parent::getDescription(); + return 'Output data with the debugging elements in JSON format' . parent::getDescription(); } else { return 'Output data in JSON format' . parent::getDescription(); } diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index ad048fe57e..b936d3beea 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -38,7 +38,7 @@ class ApiLogin extends ApiBase { /** * Executes the log-in attempt using the parameters passed. If - * the log-in succeeeds, it attaches a cookie to the session + * the log-in succeeds, it attaches a cookie to the session * and outputs the user id, username, and session token. If a * log-in fails, as the result of a bad password, a nonexistent * user, or any other reason, the host is cached with an expiry diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index 6978a75536..27f8cefd4f 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -69,7 +69,7 @@ class ApiParamInfo extends ApiBase { * @param array $params user parameters array * @param string $type parameter name * @param array $res store results in this array - * @param array $resultObj results object to set indexed tag. + * @param ApiResult $resultObj results object to set indexed tag. */ private function addModulesInfo( $params, $type, &$res, $resultObj ) { if ( !is_array( $params[$type] ) ) { @@ -291,7 +291,7 @@ class ApiParamInfo extends ApiBase { $retval['props'][] = $propResult; } - // default is true for query modules, false for other modules, overriden by ApiBase::PROP_LIST + // default is true for query modules, false for other modules, overridden by ApiBase::PROP_LIST if ( $listResult === true || ( $listResult !== false && $obj instanceof ApiQueryBase ) ) { $retval['listresult'] = ''; } diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index 95fdbce012..503c692060 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -174,7 +174,7 @@ class ApiProtect extends ApiBase { 'token' => 'A protect token previously retrieved through prop=info', 'protections' => 'List of protection levels, formatted action=group (e.g. edit=sysop)', 'expiry' => array( 'Expiry timestamps. If only one timestamp is set, it\'ll be used for all protections.', - 'Use \'infinite\', \'indefinite\' or \'never\', for a neverexpiring protection.' ), + 'Use \'infinite\', \'indefinite\' or \'never\', for a never-expiring protection.' ), 'reason' => 'Reason for (un)protecting', 'cascade' => array( 'Enable cascading protection (i.e. protect pages included in this page)', 'Ignored if not all protection levels are \'sysop\' or \'protect\'' ), diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 832284f101..0e90ed3d7c 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -507,6 +507,7 @@ class ApiQuery extends ApiBase { ); } // Report special pages + /** @var $title Title */ foreach ( $pageSet->getSpecialTitles() as $fakeId => $title ) { $vals = array(); ApiQueryBase::addTitleInfo( $vals, $title ); @@ -576,6 +577,7 @@ class ApiQuery extends ApiBase { $titles = $pageSet->getGoodTitles(); if ( count( $titles ) ) { $user = $this->getUser(); + /** @var $title Title */ foreach ( $titles as $title ) { if ( $title->userCan( 'read', $user ) ) { $exportTitles[] = $title; diff --git a/includes/api/ApiQueryAllImages.php b/includes/api/ApiQueryAllImages.php index adf203727d..e24b162c54 100644 --- a/includes/api/ApiQueryAllImages.php +++ b/includes/api/ApiQueryAllImages.php @@ -42,7 +42,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { /** * Override parent method to make sure the repo's DB is used - * which may not necesarilly be the same as the local DB. + * which may not necessarily be the same as the local DB. * * TODO: allow querying non-local repos. * @return DatabaseBase diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php index 5cf0c0b7b2..d718b9673f 100644 --- a/includes/api/ApiQueryAllPages.php +++ b/includes/api/ApiQueryAllPages.php @@ -347,7 +347,7 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { 'Show info about 4 pages starting at the letter "T"', ), 'api.php?action=query&generator=allpages&gaplimit=2&gapfilterredir=nonredirects&gapfrom=Re&prop=revisions&rvprop=content' => array( - 'Show content of first 2 non-redirect pages begining at "Re"', + 'Show content of first 2 non-redirect pages beginning at "Re"', ) ); } diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 0006da9fac..3ef6b84075 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -188,6 +188,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $titleWhere = array(); $allRedirNs = array(); $allRedirDBkey = array(); + /** @var $t Title */ foreach ( $this->redirTitles as $t ) { $redirNs = $t->getNamespace(); $redirDBkey = $t->getDBkey(); @@ -201,6 +202,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { if ( !is_null( $this->redirID ) ) { $op = $this->params['dir'] == 'descending' ? '<' : '>'; + /** @var $first Title */ $first = $this->redirTitles[0]; $title = $db->addQuotes( $first->getDBkey() ); $ns = $first->getNamespace(); diff --git a/includes/api/ApiQueryCategoryInfo.php b/includes/api/ApiQueryCategoryInfo.php index fbe555c0c8..a889272e71 100644 --- a/includes/api/ApiQueryCategoryInfo.php +++ b/includes/api/ApiQueryCategoryInfo.php @@ -48,6 +48,7 @@ class ApiQueryCategoryInfo extends ApiQueryBase { $this->getPageSet()->getMissingTitles(); $cattitles = array(); foreach ( $categories as $c ) { + /** @var $t Title */ $t = $titles[$c]; $cattitles[$c] = $t->getDBkey(); } diff --git a/includes/api/ApiQueryDuplicateFiles.php b/includes/api/ApiQueryDuplicateFiles.php index 3b044264a4..18dcba85ac 100644 --- a/includes/api/ApiQueryDuplicateFiles.php +++ b/includes/api/ApiQueryDuplicateFiles.php @@ -92,6 +92,7 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase { $sha1s = array(); foreach ( $files as $file ) { + /** @var $file File */ $sha1s[$file->getName()] = $file->getSha1(); } @@ -113,6 +114,7 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase { if( $params['dir'] == 'descending' ) { $dupFiles = array_reverse( $dupFiles ); } + /** @var $dupFile File */ foreach ( $dupFiles as $dupFile ) { $dupName = $dupFile->getName(); if( $image == $dupName && $dupFile->isLocal() ) { diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 34f78e7820..460566c8a2 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -90,6 +90,7 @@ class ApiQueryImageInfo extends ApiQueryBase { continue; } + /** @var $img File */ $img = $images[$title]; if ( self::getTransformCount() >= self::TRANSFORM_LIMIT ) { @@ -158,6 +159,7 @@ class ApiQueryImageInfo extends ApiQueryBase { // Get one more to facilitate query-continue functionality $count = ( $gotOne ? 1 : 0 ); $oldies = $img->getHistory( $params['limit'] - $count + 1, $start, $params['end'] ); + /** @var $oldie File */ foreach ( $oldies as $oldie ) { if ( ++$count > $params['limit'] ) { // We've reached the extra one which shows that there are additional pages to be had. Stop here... @@ -452,6 +454,7 @@ class ApiQueryImageInfo extends ApiQueryBase { /** * @param $img File + * @param null|string $start * @return string */ protected function getContinueStr( $img, $start = null ) { @@ -516,6 +519,7 @@ class ApiQueryImageInfo extends ApiQueryBase { /** * Returns array key value pairs of properties and their descriptions * + * @param string $modulePrefix * @return array */ private static function getProperties( $modulePrefix = '' ) { @@ -710,7 +714,7 @@ class ApiQueryImageInfo extends ApiQueryBase { array( 'code' => "{$p}urlwidth", 'info' => "{$p}urlheight cannot be used without {$p}urlwidth" ), array( 'code' => 'urlparam', 'info' => "Invalid value for {$p}urlparam" ), array( 'code' => 'urlparam_no_width', 'info' => "{$p}urlparam requires {$p}urlwidth" ), - array( 'code' => 'urlparam_urlwidth_mismatch', 'info' => "The width set in {$p}urlparm doesnt't " . + array( 'code' => 'urlparam_urlwidth_mismatch', 'info' => "The width set in {$p}urlparm doesn't " . "match the one in {$p}urlwidth" ), ) ); } diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index a888d997f2..0eaefbb43c 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -321,6 +321,7 @@ class ApiQueryInfo extends ApiQueryBase { $this->getDisplayTitle(); } + /** @var $title Title */ foreach ( $this->everything as $pageid => $title ) { $pageInfo = $this->extractPageInfo( $pageid, $title ); $fit = $result->addValue( array( @@ -462,6 +463,7 @@ class ApiQueryInfo extends ApiQueryBase { $res = $this->select( __METHOD__ ); foreach ( $res as $row ) { + /** @var $title Title */ $title = $this->titles[$row->pr_page]; $a = array( 'type' => $row->pr_type, @@ -597,6 +599,7 @@ class ApiQueryInfo extends ApiQueryBase { private function getTSIDs() { $getTitles = $this->talkids = $this->subjectids = array(); + /** @var $t Title */ foreach ( $this->everything as $t ) { if ( MWNamespace::isTalk( $t->getNamespace() ) ) { if ( $this->fld_subjectid ) { diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index 0aaa588a9c..ac65d2d2e5 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -25,7 +25,7 @@ */ /** - * A query module to list all langlinks (links to correspanding foreign language pages). + * A query module to list all langlinks (links to corresponding foreign language pages). * * @ingroup API */ diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index f89c826206..73dcea494d 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -451,7 +451,7 @@ class ApiQueryLogEvents extends ApiQueryBase { ' timestamp - Adds the timestamp for the event', ' comment - Adds the comment of the event', ' parsedcomment - Adds the parsed comment of the event', - ' details - Lists addtional details about the event', + ' details - Lists additional details about the event', ' tags - Lists tags for the event', ), 'type' => 'Filter log entries to only this type', diff --git a/includes/api/ApiQueryQueryPage.php b/includes/api/ApiQueryQueryPage.php index 1c9deb711c..b03bdfb83a 100644 --- a/includes/api/ApiQueryQueryPage.php +++ b/includes/api/ApiQueryQueryPage.php @@ -75,6 +75,7 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { $params = $this->extractRequestParams(); $result = $this->getResult(); + /** @var $qp QueryPage */ $qp = new $this->qpMap[$params['page']](); if ( !$qp->userCanExecute( $this->getUser() ) ) { $this->dieUsageMsg( 'specialpage-cantexecute' ); @@ -141,6 +142,7 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { } public function getCacheMode( $params ) { + /** @var $qp QueryPage */ $qp = new $this->qpMap[$params['page']](); if ( $qp->getRestriction() != '' ) { return 'private'; diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php index 99854c17eb..ae3bb89320 100644 --- a/includes/api/ApiQueryRandom.php +++ b/includes/api/ApiQueryRandom.php @@ -33,6 +33,8 @@ class ApiQueryRandom extends ApiQueryGeneratorBase { + private $pageIDs; + public function __construct( $query, $moduleName ) { parent::__construct( $query, $moduleName, 'rn' ); } diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 24849bd899..2fcfb79029 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -335,7 +335,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { /** * Extracts from a single sql row the data needed to describe one recent change. * - * @param $row The row from which to extract the data. + * @param mixed $row The row from which to extract the data. * @return array An array mapping strings (descriptors) to their respective string values. * @access public */ diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 518266fad4..192fe873f4 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -196,6 +196,7 @@ class ApiQueryRevisions extends ApiQueryBase { if ( isset( $prop['content'] ) || !is_null( $this->difftotext ) ) { // For each page we will request, the user must have read rights for that page $user = $this->getUser(); + /** @var $title Title */ foreach ( $pageSet->getGoodTitles() as $title ) { if ( !$title->userCan( 'read', $user ) ) { $this->dieUsage( diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 2410f057c9..597c412d05 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -442,7 +442,7 @@ class ApiQueryContributions extends ApiQueryBase { 'end' => 'The end timestamp to return to', 'continue' => 'When more results are available, use this to continue', 'user' => 'The users to retrieve contributions for', - 'userprefix' => "Retrieve contibutions for all users whose names begin with this value. Overrides {$p}user", + 'userprefix' => "Retrieve contributions for all users whose names begin with this value. Overrides {$p}user", 'dir' => $this->getDirectionDescription( $p ), 'namespace' => 'Only list contributions in these namespaces', 'prop' => array( diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index dd5062450a..4030bcedf3 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -511,7 +511,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { 'api.php?action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment', 'api.php?action=query&generator=watchlist&prop=info', 'api.php?action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user', - 'api.php?action=query&list=watchlist&wlowner=Bob_Smith&wltoken=d8d562e9725ea1512894cdab28e5ceebc7f20237' + 'api.php?action=query&list=watchlist&wlowner=Bob_Smith&wltoken=123ABC' ); } diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index 790f2d8a0b..0e1f93352f 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -36,8 +36,8 @@ * There are two special key values that change how XML output is generated: * '_element' This key sets the tag name for the rest of the elements in the current array. * It is only inserted if the formatter returned true for getNeedsRawData() - * '*' This key has special meaning only to the XML formatter, and is outputed as is - * for all others. In XML it becomes the content of the current element. + * '*' This key has special meaning only to the XML formatter, and is outputted as is + * for all others. In XML it becomes the content of the current element. * * @ingroup API */ diff --git a/includes/api/ApiSetNotificationTimestamp.php b/includes/api/ApiSetNotificationTimestamp.php index 8ef1a978cf..b40476a52c 100644 --- a/includes/api/ApiSetNotificationTimestamp.php +++ b/includes/api/ApiSetNotificationTimestamp.php @@ -133,6 +133,7 @@ class ApiSetNotificationTimestamp extends ApiBase { } // Now, put the valid titles into the result + /** @var $title Title */ foreach ( $pageSet->getTitles() as $title ) { $ns = $title->getNamespace(); $dbkey = $title->getDBkey(); @@ -283,9 +284,9 @@ class ApiSetNotificationTimestamp extends ApiBase { public function getExamples() { return array( - 'api.php?action=setnotificationtimestamp&entirewatchlist=&token=ABC123' => 'Reset the notification status for the entire watchlist', - 'api.php?action=setnotificationtimestamp&titles=Main_page&token=ABC123' => 'Reset the notification status for "Main page"', - 'api.php?action=setnotificationtimestamp&titles=Main_page×tamp=2012-01-01T00:00:00Z&token=ABC123' => 'Set the notification timestamp for "Main page" so all edits since 1 January 2012 are unviewed', + 'api.php?action=setnotificationtimestamp&entirewatchlist=&token=123ABC' => 'Reset the notification status for the entire watchlist', + 'api.php?action=setnotificationtimestamp&titles=Main_page&token=123ABC' => 'Reset the notification status for "Main page"', + 'api.php?action=setnotificationtimestamp&titles=Main_page×tamp=2012-01-01T00:00:00Z&token=123ABC' => 'Set the notification timestamp for "Main page" so all edits since 1 January 2012 are unviewed', ); } diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index e2e53f8fd8..39cc754135 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -71,6 +71,7 @@ class ApiUpload extends ApiBase { $this->checkPermissions( $user ); // Fetch the file (usually a no-op) + /** @var $status Status */ $status = $this->mUpload->fetchFile(); if ( !$status->isGood() ) { $errors = $status->getErrorsArray(); @@ -116,13 +117,13 @@ class ApiUpload extends ApiBase { } /** - * Get an uplaod result based on upload context + * Get an upload result based on upload context * @return array */ private function getContextResult() { $warnings = $this->getApiWarnings(); if ( $warnings && !$this->mParams['ignorewarnings'] ) { - // Get warnings formated in result array format + // Get warnings formatted in result array format return $this->getWarningsResult( $warnings ); } elseif ( $this->mParams['chunk'] ) { // Add chunk, and get result @@ -137,7 +138,7 @@ class ApiUpload extends ApiBase { } /** - * Get Stash Result, throws an expetion if the file could not be stashed. + * Get Stash Result, throws an exception if the file could not be stashed. * @param $warnings array Array of Api upload warnings * @return array */ @@ -197,6 +198,7 @@ class ApiUpload extends ApiBase { $filekey = $this->performStash(); } else { $filekey = $this->mParams['filekey']; + /** @var $status Status */ $status = $this->mUpload->addChunk( $chunkPath, $chunkSize, $this->mParams['offset'] ); if ( !$status->isGood() ) { @@ -565,6 +567,7 @@ class ApiUpload extends ApiBase { $this->mParams['text'] = $this->mParams['comment']; } + /** @var $file File */ $file = $this->mUpload->getLocalFile(); $watch = $this->getWatchlistValue( $this->mParams['watchlist'], $file->getTitle() ); @@ -603,6 +606,7 @@ class ApiUpload extends ApiBase { "Failed to start PublishStashedFile.php", 'publishfailed' ); } } else { + /** @var $status Status */ $status = $this->mUpload->performUpload( $this->mParams['comment'], $this->mParams['text'], $watch, $this->getUser() ); -- 2.20.1