From 89656cc42c59e6776c4023e8800f0b613e0d64c0 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 7 Mar 2011 14:59:41 +0000 Subject: [PATCH] More documentation Remove trailing whitespace --- includes/api/ApiFileRevert.php | 14 ++++++-------- includes/api/ApiMove.php | 7 +++++++ includes/filerepo/LocalRepo.php | 5 +++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/includes/api/ApiFileRevert.php b/includes/api/ApiFileRevert.php index 9ae309a59b..3a183a4780 100644 --- a/includes/api/ApiFileRevert.php +++ b/includes/api/ApiFileRevert.php @@ -39,7 +39,7 @@ class ApiFileRevert extends ApiBase { */ protected $file; protected $archiveName; - + protected $params; public function __construct( $main, $action ) { @@ -54,11 +54,11 @@ class ApiFileRevert extends ApiBase { $this->params = $this->extractRequestParams(); $this->validateParameters(); - + $sourceUrl = $this->file->getArchiveVirtualUrl( $this->archiveName ); $status = $this->file->upload( $sourceUrl, $this->params['comment'], $this->params['comment'] ); - + if ( $status->isGood() ) { $result = array( 'result' => 'Success' ); } else { @@ -67,7 +67,7 @@ class ApiFileRevert extends ApiBase { 'errors' => $this->getResult()->convertStatusToArray( $status ), ); } - + $this->getResult()->addValue( null, $this->getModuleName(), $result ); } @@ -88,7 +88,7 @@ class ApiFileRevert extends ApiBase { } } } - + /** * Validate the user parameters and set $this->archiveName and $this->file. * Throws an error if validation fails @@ -104,7 +104,7 @@ class ApiFileRevert extends ApiBase { if ( !$this->file->exists() ) { $this->dieUsageMsg( array( 'notanarticle' ) ); } - + // Check if the archivename is valid for this file $this->archiveName = $this->params['archivename']; $oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $this->archiveName ); @@ -112,8 +112,6 @@ class ApiFileRevert extends ApiBase { $this->dieUsageMsg( array( 'filerevert-badversion' ) ); } } - - public function mustBePosted() { return true; diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index 28ad025736..3132de6e09 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -135,6 +135,13 @@ class ApiMove extends ApiBase { $this->getResult()->addValue( null, $this->getModuleName(), $r ); } + /** + * @param Title $fromTitle + * @param Title $toTitle + * @param $reason + * @param $noredirect + * @return array + */ public function moveSubpages( $fromTitle, $toTitle, $reason, $noredirect ) { $retval = array(); $success = $fromTitle->moveSubpages( $toTitle, true, $reason, !$noredirect ); diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index bbd99aaba2..e72f32b858 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -18,6 +18,11 @@ class LocalRepo extends FSRepo { var $fileFromRowFactory = array( 'LocalFile', 'newFromRow' ); var $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' ); + /** + * @throws MWException + * @param $row + * @return File + */ function newFileFromRow( $row ) { if ( isset( $row->img_name ) ) { return call_user_func( $this->fileFromRowFactory, $row, $this ); -- 2.20.1