From 0d47a2ae90cb240a2998f00076af0757d27cdeda Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 28 May 2011 14:52:55 +0000 Subject: [PATCH] More parameter documentation!! --- includes/EditPage.php | 2 +- includes/Linker.php | 3 +++ includes/User.php | 4 +++- includes/db/Database.php | 2 +- includes/db/DatabasePostgres.php | 8 ++++++++ includes/filerepo/OldLocalFile.php | 2 ++ includes/installer/Installer.php | 2 ++ includes/installer/WebInstaller.php | 2 ++ includes/installer/WebInstallerPage.php | 7 +++++++ includes/specials/SpecialUndelete.php | 14 ++++++++++++-- 10 files changed, 41 insertions(+), 5 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index f69df43412..5a81f9be2b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1111,7 +1111,7 @@ class EditPage { $hasmatch = preg_match( "/^ *([=]{1,6})(.*?)(\\1) *\\n/i", $this->textbox1, $matches ); # we can't deal with anchors, includes, html etc in the header for now, # headline would need to be parsed to improve this - if ( $hasmatch and strlen( $matches[2] ) > 0 ) { + if ( $hasmatch && strlen( $matches[2] ) > 0 ) { $sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $matches[2] ); } } diff --git a/includes/Linker.php b/includes/Linker.php index 7d30406ae0..092fff60f4 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1067,6 +1067,9 @@ class Linker { return $comment; } + /** + * @var Title + */ static $autocommentTitle; static $autocommentLocal; diff --git a/includes/User.php b/includes/User.php index 20946f5696..5637a066e2 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1066,7 +1066,9 @@ class User { } /** - * Load the data for this user object from another user object. + * Load the data for this user object from another user object. + * + * @param $user User */ protected function loadFromUserObject( $user ) { $user->load(); diff --git a/includes/db/Database.php b/includes/db/Database.php index c181a112be..b26970eb0d 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -662,7 +662,7 @@ abstract class DatabaseBase implements DatabaseType { * comment (you can use __METHOD__ or add some extra info) * @param $tempIgnore Boolean: Whether to avoid throwing an exception on errors... * maybe best to catch the exception instead? - * @return boolean or ResultWrapper. true for a successful write query, ResultWrapper object for a successful read query, + * @return boolean|ResultWrapper. true for a successful write query, ResultWrapper object for a successful read query, * or false on failure if $tempIgnore set * @throws DBQueryError Thrown when the database returns an error of any kind */ diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index ce2fba89e6..94c0b80a7e 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -929,6 +929,10 @@ SQL; return $sql; } + /** + * @param $b + * @return Blob + */ function encodeBlob( $b ) { return new Blob( pg_escape_bytea( $this->mConn, $b ) ); } @@ -944,6 +948,10 @@ SQL; return pg_escape_string( $this->mConn, $s ); } + /** + * @param $s null|bool|Blob + * @return int|string + */ function addQuotes( $s ) { if ( is_null( $s ) ) { return 'NULL'; diff --git a/includes/filerepo/OldLocalFile.php b/includes/filerepo/OldLocalFile.php index d921a6b400..ba07e4fafd 100644 --- a/includes/filerepo/OldLocalFile.php +++ b/includes/filerepo/OldLocalFile.php @@ -218,6 +218,8 @@ class OldLocalFile extends LocalFile { * @param $srcPath string File system path of the source file * @param $archiveName string Full archive name of the file, in the form * $timestamp!$filename, where $filename must match $this->getName() + * + * @return FileRepoStatus */ function uploadOld( $srcPath, $archiveName, $timestamp, $comment, $user, $flags = 0 ) { $this->lock(); diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index f0ea4f670a..25449cef43 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1173,6 +1173,8 @@ abstract class Installer { /** * ParserOptions are constructed before we determined the language, so fix it + * + * @param $lang Language */ public function setParserLanguage( $lang ) { $this->parserOptions->setTargetLanguage( $lang ); diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 2274c9d9c8..ebea68be58 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -953,6 +953,8 @@ class WebInstaller extends Installer { /** * Output an error or warning box using a Status object. + * + * @param $status Status */ public function showStatusBox( $status ) { if( !$status->isGood() ) { diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index d450d92d55..ac11459788 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -924,6 +924,9 @@ class WebInstaller_Options extends WebInstallerPage { $this->endForm(); } + /** + * @return string + */ public function getCCPartnerUrl() { global $wgServer; $exitUrl = $wgServer . $this->parent->getUrl( array( @@ -1112,6 +1115,10 @@ class WebInstaller_Install extends WebInstallerPage { } } + /** + * @param $step + * @param $status Status + */ public function endStage( $step, $status ) { if ( $step == 'extension-tables' ) { $this->endLiveBox(); diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index a4d9b99443..b9dc747f54 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -570,9 +570,14 @@ class PageArchive { * @ingroup SpecialPage */ class SpecialUndelete extends SpecialPage { - var $mAction, $mTarget, $mTimestamp, $mRestore, $mInvert, $mTargetObj, $mFile; + var $mAction, $mTarget, $mTimestamp, $mRestore, $mInvert, $mFile; var $mTargetTimestamp, $mAllowed, $mCanView, $mComment, $mToken, $mRequest; + /** + * @var Title + */ + var $mTargetObj; + function __construct( $request = null ) { parent::__construct( 'Undelete', 'deletedhistory' ); @@ -734,7 +739,12 @@ class SpecialUndelete extends SpecialPage { ); } - // Generic list of deleted pages + /** + * Generic list of deleted pages + * + * @param $result ResultWrapper + * @return bool + */ private function showList( $result ) { global $wgLang, $wgUser, $wgOut; -- 2.20.1