From 68480e2ed314ffda58fd29d3382d8b8347dccbbe Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 24 Dec 2011 23:11:25 +0000 Subject: [PATCH] Improve/add to documentation Add braces Explicitly define member variable --- includes/SpecialPage.php | 2 +- includes/specials/SpecialContributions.php | 7 +++++++ includes/specials/SpecialUserlogin.php | 3 ++- includes/upload/UploadFromUrl.php | 11 +++++++++-- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index c859f004c0..17a36ecf10 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -672,7 +672,7 @@ class SpecialPage { /** * Gets the context this SpecialPage is executed in * - * @return IContextSource + * @return IContextSource|RequestContext * @since 1.18 */ public function getContext() { diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 6d6714be35..6ed4b20f2b 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -268,6 +268,7 @@ class SpecialContributions extends SpecialPage { * @param $talkpage Title: Talk page * @param $target User: Target user object * @param $subject User: The viewing user ($wgUser might be still checked in some cases) + * @return array */ public static function getUserLinks( Title $userpage, Title $talkpage, User $target, User $subject ) { @@ -716,10 +717,16 @@ class ContribsPager extends ReverseChronologicalPager { return $revLens; } + /** + * @return string + */ function getStartBody() { return "\n"; } diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 83ab23469e..4882058f4d 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -1072,8 +1072,9 @@ class LoginForm extends SpecialPage { # Prepare language selection links as needed if( $wgLoginLanguageSelector ) { $template->set( 'languages', $this->makeLanguageSelector() ); - if( $this->mLanguage ) + if( $this->mLanguage ) { $template->set( 'uselang', $this->mLanguage ); + } } // Use loginend-https for HTTPS requests if it's not blank, loginend otherwise diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index a7aa30b8ee..747b842cb3 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -7,12 +7,11 @@ * @author Bryan Tong Minh * @author Michael Dale */ - class UploadFromUrl extends UploadBase { protected $mAsync, $mUrl; protected $mIgnoreWarnings = true; - protected $mTempPath; + protected $mTempPath, $mTmpHandle; /** * Checks if the user is allowed to use the upload-by-URL feature. If the @@ -78,6 +77,7 @@ class UploadFromUrl extends UploadBase { /** * @param $request WebRequest object + * @return bool */ public static function isValidRequest( $request ) { global $wgUser; @@ -88,8 +88,14 @@ class UploadFromUrl extends UploadBase { && $wgUser->isAllowed( 'upload_by_url' ); } + /** + * @return string + */ public function getSourceType() { return 'url'; } + /** + * @return Status + */ public function fetchFile() { if ( !Http::isValidURI( $this->mUrl ) ) { return Status::newFatal( 'http-invalid-url' ); @@ -133,6 +139,7 @@ class UploadFromUrl extends UploadBase { /** * Download the file, save it to the temporary file and update the file * size and set $mRemoveTempFile to true. + * @return Status */ protected function reallyFetchFile() { if ( $this->mTempPath === false ) { -- 2.20.1