From d4b046a8934d1206e5f6eb6b3d1ba206db814a46 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 8 Oct 2012 01:35:26 +0200 Subject: [PATCH] Update docs for return and exception info * Removed some inline tabs in the process. * IDE fixed some incorrect leading spaces, too. Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190 --- includes/Action.php | 3 +- includes/Autopromote.php | 1 + includes/BacklinkCache.php | 3 + includes/Block.php | 4 + includes/Category.php | 1 + includes/CategoryViewer.php | 1 + includes/Cdb_PHP.php | 4 +- includes/ChangeTags.php | 6 +- includes/ConfEditor.php | 5 + includes/Cookie.php | 9 +- includes/DataUpdate.php | 1 + includes/EditPage.php | 3 + includes/Export.php | 1 + includes/ExternalStore.php | 4 +- includes/FileDeleteForm.php | 1 + includes/FormOptions.php | 5 +- includes/GlobalFunctions.php | 6 + includes/HTMLForm.php | 9 +- includes/HttpFunctions.php | 2 + includes/Import.php | 1 + includes/Linker.php | 1 + includes/LinksUpdate.php | 1 + includes/LocalisationCache.php | 4 + includes/Message.php | 2 + includes/MessageBlobStore.php | 1 + includes/Namespace.php | 1 + includes/OutputPage.php | 5 +- includes/QueryPage.php | 1 + includes/Revision.php | 3 + includes/Sanitizer.php | 1 + includes/Skin.php | 1 + includes/SkinTemplate.php | 1 + includes/SpecialPage.php | 4 +- includes/StreamFile.php | 1 + includes/StubObject.php | 1 + includes/User.php | 1 + includes/UserMailer.php | 1 + includes/WebRequest.php | 6 +- includes/Wiki.php | 1 + includes/Xml.php | 1 + includes/ZipDirectoryReader.php | 1 + includes/actions/InfoAction.php | 2 + includes/cache/HTMLFileCache.php | 1 + includes/cache/MessageCache.php | 3 +- includes/conf/Conf.php | 4 +- includes/context/DerivativeContext.php | 1 + includes/context/RequestContext.php | 2 + includes/db/Database.php | 20 +- includes/db/DatabaseIbm_db2.php | 13 +- includes/db/DatabaseMssql.php | 20 ++ includes/db/DatabaseMysql.php | 3 +- includes/db/DatabaseOracle.php | 5 + includes/db/DatabasePostgres.php | 5 + includes/db/DatabaseSqlite.php | 10 +- includes/db/LBFactory_Multi.php | 6 +- includes/db/LoadBalancer.php | 7 +- includes/filebackend/FileBackend.php | 1 + .../filebackend/FileBackendMultiWrite.php | 1 + includes/filebackend/FileBackendStore.php | 2 + .../lockmanager/MemcLockManager.php | 1 + includes/filerepo/FileRepo.php | 1 + includes/filerepo/file/ArchivedFile.php | 1 + includes/installer/PostgresInstaller.php | 1 + includes/logging/LogFormatter.php | 1 + includes/media/Bitmap.php | 6 +- includes/media/BitmapMetadataHandler.php | 1 + includes/media/Exif.php | 1 + includes/media/GIFMetadataExtractor.php | 5 +- includes/media/JpegMetadataExtractor.php | 9 +- includes/media/MediaTransformOutput.php | 1 + includes/media/SVG.php | 17 +- includes/media/SVGMetadataExtractor.php | 3 + includes/media/Tiff.php | 5 +- includes/media/XMP.php | 247 +++++++++--------- includes/objectcache/EhcacheBagOStuff.php | 1 + includes/objectcache/RedisBagOStuff.php | 2 + includes/parser/CoreTagHooks.php | 1 + includes/parser/Parser.php | 18 +- includes/parser/ParserCache.php | 1 + includes/parser/ParserOutput.php | 2 + includes/parser/Parser_LinkHooks.php | 9 +- includes/parser/Preprocessor_DOM.php | 4 + includes/parser/Preprocessor_Hash.php | 9 +- includes/parser/Preprocessor_HipHop.hphp | 1 + includes/resourceloader/ResourceLoader.php | 2 + .../ResourceLoaderFileModule.php | 74 +++--- .../RevisionDeleteAbstracts.php | 1 + includes/specials/SpecialJavaScriptTest.php | 1 + includes/specials/SpecialPasswordReset.php | 2 + includes/specials/SpecialRevisiondelete.php | 1 + includes/specials/SpecialUnblock.php | 1 + includes/specials/SpecialUpload.php | 1 + includes/specials/SpecialUploadStash.php | 11 +- includes/specials/SpecialUserlogin.php | 1 + includes/specials/SpecialUserrights.php | 1 + includes/upload/UploadStash.php | 6 +- languages/utils/CLDRPluralRuleEvaluator.php | 1 + maintenance/language/checkLanguage.inc | 2 + maintenance/locking/LockServerDaemon.php | 3 + maintenance/sqlite.inc | 2 + 100 files changed, 458 insertions(+), 215 deletions(-) diff --git a/includes/Action.php b/includes/Action.php index 51922251c0..19552bc2e4 100644 --- a/includes/Action.php +++ b/includes/Action.php @@ -272,7 +272,7 @@ abstract class Action { * must throw subclasses of ErrorPageError * * @param $user User: the user to check, or null to use the context user - * @throws ErrorPageError + * @throws UserBlockedError|ReadOnlyError|PermissionsError * @return bool True on success */ protected function checkCanExecute( User $user ) { @@ -546,6 +546,7 @@ abstract class FormlessAction extends Action { * forms, they probably won't have any data, but some (eg rollback) may do * @param $data Array values that would normally be in the GET request * @param $captureErrors Bool whether to catch exceptions and just return false + * @throws ErrorPageError * @return Bool whether execution was successful */ public function execute( array $data = null, $captureErrors = true ) { diff --git a/includes/Autopromote.php b/includes/Autopromote.php index 9c77855d74..d7ed2f904b 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -157,6 +157,7 @@ class Autopromote { * * @param $cond Array: A condition, which must not contain other conditions * @param $user User The user to check the condition against + * @throws MWException * @return bool Whether the condition is true for the user */ private static function checkCondition( $cond, User $user ) { diff --git a/includes/BacklinkCache.php b/includes/BacklinkCache.php index d2055dd5c5..ba8691b292 100644 --- a/includes/BacklinkCache.php +++ b/includes/BacklinkCache.php @@ -217,6 +217,7 @@ class BacklinkCache { /** * Get the field name prefix for a given table * @param $table String + * @throws MWException * @return null|string */ protected function getPrefix( $table ) { @@ -245,6 +246,7 @@ class BacklinkCache { * Get the SQL condition array for selecting backlinks, with a join * on the page table. * @param $table String + * @throws MWException * @return array|null */ protected function getConditions( $table ) { @@ -381,6 +383,7 @@ class BacklinkCache { * Partition a DB result with backlinks in it into batches * @param $res ResultWrapper database result * @param $batchSize integer + * @throws MWException * @return array @see */ protected function partitionResult( $res, $batchSize ) { diff --git a/includes/Block.php b/includes/Block.php index 732699dce6..86b4d13d36 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -231,6 +231,7 @@ class Block { * 3) An autoblock on the given IP * @param $vagueTarget User|String 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 */ protected function newLoad( $vagueTarget = null ) { @@ -426,6 +427,7 @@ class Block { /** * Delete the row from the IP blocks table. * + * @throws MWException * @return Boolean */ public function delete() { @@ -780,6 +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 */ public function getRangeStart() { @@ -797,6 +800,7 @@ class Block { /** * Get the IP address at the start of the range in Hex form + * @throws MWException * @return String IP in Hex form */ public function getRangeEnd() { diff --git a/includes/Category.php b/includes/Category.php index b7b12e8a31..ffd7bb8bda 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -44,6 +44,7 @@ class Category { /** * Set up all member variables using a database query. + * @throws MWException * @return bool True on success, false on failure. */ protected function initialize() { diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 3bb2bc9b1c..3d66b74a26 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -613,6 +613,7 @@ class CategoryViewer extends ContextSource { * * @param Title $title: The title (usually $this->title) * @param String $section: Which section + * @throws MWException * @return Title */ private function addFragmentToTitle( $title, $section ) { diff --git a/includes/Cdb_PHP.php b/includes/Cdb_PHP.php index 02be65f3b3..c97cf13c11 100644 --- a/includes/Cdb_PHP.php +++ b/includes/Cdb_PHP.php @@ -126,6 +126,7 @@ class CdbReader_PHP extends CdbReader { /** * @param $fileName string + * @throws MWException */ function __construct( $fileName ) { $this->fileName = $fileName; @@ -198,7 +199,8 @@ class CdbReader_PHP extends CdbReader { /** * Unpack an unsigned integer and throw an exception if it needs more than 31 bits * @param $s - * @return + * @throws MWException + * @return mixed */ protected function unpack31( $s ) { $data = unpack( 'V', $s ); diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index a97cb03482..18f425ae5c 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -81,6 +81,7 @@ class ChangeTags { * @param $log_id int: log_id of the change to add the tags to * @param $params String: params to put in the ct_params field of tabel 'change_tag' * + * @throws MWException * @return bool: false if no changes are made, otherwise true * * @exception MWException when $rc_id, $rev_id and $log_id are all null @@ -164,10 +165,9 @@ class ChangeTags { * @param $conds String|Array: conditions used in query, see DatabaseBase::select * @param $join_conds Array: join conditions, see DatabaseBase::select * @param $options Array: options, see Database::select - * @param $filter_tag String: tag to select on - * - * @exception MWException when unable to determine appropriate JOIN condition for tagging + * @param bool|string $filter_tag Tag to select on * + * @throws MWException When unable to determine appropriate JOIN condition for tagging */ static function modifyDisplayQuery( &$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag = false ) { diff --git a/includes/ConfEditor.php b/includes/ConfEditor.php index b68fc76206..d304e65ee2 100644 --- a/includes/ConfEditor.php +++ b/includes/ConfEditor.php @@ -159,6 +159,7 @@ class ConfEditor { * insert * Insert a new element at the start of the array. * + * @throws MWException * @return string */ public function edit( $ops ) { @@ -392,6 +393,8 @@ class ConfEditor { * Finds the source byte region which you would want to delete, if $pathName * was to be deleted. Includes the leading spaces and tabs, the trailing line * break, and any comments in between. + * @param $pathName + * @throws MWException * @return array */ function findDeletionRegion( $pathName ) { @@ -450,6 +453,8 @@ class ConfEditor { * or semicolon. * * The end position is the past-the-end (end + 1) value as per convention. + * @param $pathName + * @throws MWException * @return array */ function findValueRegion( $pathName ) { diff --git a/includes/Cookie.php b/includes/Cookie.php index 7984d63e34..1b86f5da83 100644 --- a/includes/Cookie.php +++ b/includes/Cookie.php @@ -40,14 +40,15 @@ class Cookie { /** * Sets a cookie. Used before a request to set up any individual - * cookies. Used internally after a request to parse the + * cookies. Used internally after a request to parse the * Set-Cookie headers. * * @param $value String: the value of the cookie * @param $attr Array: possible key/values: - * expires A date string - * path The path this cookie is used on - * domain Domain this cookie is used on + * expires A date string + * path The path this cookie is used on + * domain Domain this cookie is used on + * @throws MWException */ public function set( $value, $attr ) { $this->value = $value; diff --git a/includes/DataUpdate.php b/includes/DataUpdate.php index 377b64c0cf..088bb7e774 100644 --- a/includes/DataUpdate.php +++ b/includes/DataUpdate.php @@ -76,6 +76,7 @@ abstract class DataUpdate implements DeferrableUpdate { * * @static * @param $updates array a list of DataUpdate instances + * @throws Exception|null */ public static function runUpdates( $updates ) { if ( empty( $updates ) ) return; # nothing to do diff --git a/includes/EditPage.php b/includes/EditPage.php index 1ae7f110c2..35328f870f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -456,6 +456,7 @@ class EditPage { * @since 1.19 * @param $permErrors Array of permissions errors, as returned by * Title::getUserPermissionsErrors(). + * @throws PermissionsError */ protected function displayPermissionsError( array $permErrors ) { global $wgRequest, $wgOut; @@ -1090,6 +1091,7 @@ class EditPage { /** * Attempt submission + * @throws UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError * @return bool false if output is done, true if the rest of the form should be displayed */ function attemptSave() { @@ -2827,6 +2829,7 @@ HTML /** * Get the rendered text for previewing. + * @throws MWException * @return string */ function getPreviewText() { diff --git a/includes/Export.php b/includes/Export.php index 348b3474b4..e2b01b5397 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -1347,6 +1347,7 @@ class DumpNamespaceFilter extends DumpFilter { /** * @param $sink DumpOutput * @param $param + * @throws MWException */ function __construct( &$sink, $param ) { parent::__construct( $sink ); diff --git a/includes/ExternalStore.php b/includes/ExternalStore.php index 26e456c261..1b7c29dbbb 100644 --- a/includes/ExternalStore.php +++ b/includes/ExternalStore.php @@ -130,8 +130,8 @@ class ExternalStore { * * @param $data String * @param $storageParams Array: associative array of parameters for the ExternalStore object. - * @throws DBConnectionError|DBQueryError|MWException - * @return string The URL of the stored data item, or false on error + * @throws MWException|DBConnectionError|DBQueryError + * @return string|bool The URL of the stored data item, or false on error */ public static function insertToDefault( $data, $storageParams = array() ) { global $wgDefaultExternalStore; diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 7e616b2493..e2fcd9cb15 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -144,6 +144,7 @@ class FileDeleteForm { * @param $reason String: reason of the deletion * @param $suppress Boolean: whether to mark all deleted versions as restricted * @param $user User object performing the request + * @throws MWException * @return bool|Status */ public static function doDelete( &$title, &$file, &$oldimage, $reason, $suppress, User $user = null ) { diff --git a/includes/FormOptions.php b/includes/FormOptions.php index 33bbd86a6f..f978639de1 100644 --- a/includes/FormOptions.php +++ b/includes/FormOptions.php @@ -83,6 +83,7 @@ class FormOptions implements ArrayAccess { * which will be assumed as INT if the data is an integer. * * @param $data Mixed: value to guess type for + * @throws MWException * @exception MWException Unsupported datatype * @return int Type constant */ @@ -105,6 +106,7 @@ class FormOptions implements ArrayAccess { * * @param $name String: option name * @param $strict Boolean: throw an exception when the option does not exist (default false) + * @throws MWException * @return Boolean: true if option exist, false otherwise */ public function validateName( $name, $strict = false ) { @@ -205,11 +207,12 @@ class FormOptions implements ArrayAccess { /** * Validate and set an option integer value - * The value will be altered to fit in the range. + * The value will be altered to fit in the range. * * @param $name String: option name * @param $min Int: minimum value * @param $max Int: maximum value + * @throws MWException * @exception MWException Option is not of type int * @return null */ diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3bbf62f0a0..3de25e716d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -169,6 +169,7 @@ function wfArrayLookup( $a, $b ) { * @param $value Mixed * @param $default Mixed * @param $changed Array to alter + * @throws MWException */ function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) { if ( is_null( $changed ) ) { @@ -1110,6 +1111,7 @@ function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) { * * @param $text String * @param $file String filename + * @throws MWException */ function wfErrorLog( $text, $file ) { if ( substr( $file, 0, 4 ) == 'udp:' ) { @@ -1719,6 +1721,7 @@ function wfEmptyMsg( $key ) { * but now throws an exception instead, with similar results. * * @param $msg String: message shown when dying. + * @throws MWException */ function wfDebugDieBacktrace( $msg = '' ) { throw new MWException( $msg ); @@ -2512,6 +2515,7 @@ function wfTempDir() { * @param $dir String: full path to directory to create * @param $mode Integer: chmod value to use, default is $wgDirectoryMode * @param $caller String: optional caller param for debugging. + * @throws MWException * @return bool */ function wfMkdirParents( $dir, $mode = null, $caller = null ) { @@ -3022,6 +3026,7 @@ function wfDiff( $before, $after, $params = '-u' ) { * * @param $req_ver Mixed: the version to check, can be a string, an integer, or * a float + * @throws MWException */ function wfUsePHP( $req_ver ) { $php_ver = PHP_VERSION; @@ -3043,6 +3048,7 @@ function wfUsePHP( $req_ver ) { * * @param $req_ver Mixed: the version to check, can be a string, an integer, or * a float + * @throws MWException */ function wfUseMW( $req_ver ) { global $wgVersion; diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 5c00b9f6e7..21011a4087 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -248,6 +248,7 @@ class HTMLForm extends ContextSource { * Set format in which to display the form * @param $format String the name of the format to use, must be one of * $this->availableDisplayFormats + * @throws MWException * @since 1.20 * @return HTMLForm $this for chaining calls (since 1.20) */ @@ -279,6 +280,7 @@ class HTMLForm extends ContextSource { * Initialise a new Object for the field * @param $fieldname string * @param $descriptor string input Descriptor, as described above + * @throws MWException * @return HTMLFormField subclass */ static function loadInputFromParameters( $fieldname, $descriptor ) { @@ -312,6 +314,7 @@ class HTMLForm extends ContextSource { * @attention When doing method chaining, that should be the very last * method call before displayForm(). * + * @throws MWException * @return HTMLForm $this for chaining calls (since 1.20) */ function prepareForm() { @@ -375,9 +378,10 @@ class HTMLForm extends ContextSource { /** * Validate all the fields, and call the submision callback * function if everything is kosher. + * @throws MWException * @return Mixed Bool true == Successful submission, Bool false - * == No submission attempted, anything else == Error to - * display. + * == No submission attempted, anything else == Error to + * display. */ function trySubmit() { # Check for validation @@ -1177,6 +1181,7 @@ abstract class HTMLFormField { /** * Initialise the object * @param $params array Associative Array. See HTMLForm doc for syntax. + * @throws MWException */ function __construct( $params ) { $this->mParams = $params; diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 8453e62cc9..32f77dcfab 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -265,6 +265,7 @@ class MWHttpRequest { * Generate a new request object * @param $url String: url to use * @param $options Array: (optional) extra params to pass (see Http::request()) + * @throws MWException * @return CurlHttpRequest|PhpHttpRequest * @see MWHttpRequest::__construct */ @@ -393,6 +394,7 @@ class MWHttpRequest { * will be aborted. * * @param $callback Callback + * @throws MWException */ public function setCallback( $callback ) { if ( !is_callable( $callback ) ) { diff --git a/includes/Import.php b/includes/Import.php index 27463821fa..c9b09975fd 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -429,6 +429,7 @@ class WikiImporter { /** * Primary entry point + * @throws MWException * @return bool */ public function doImport() { diff --git a/includes/Linker.php b/includes/Linker.php index 97b03be800..c17e2d1687 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -448,6 +448,7 @@ class Linker { * @param $context IContextSource context to use to get the messages * @param $namespace int Namespace number * @param $title string Text of the title, without the namespace part + * @return string */ public static function getInvalidTitleDescription( IContextSource $context, $namespace, $title ) { global $wgContLang; diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 2b462608f1..fd1fefb831 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -49,6 +49,7 @@ class LinksUpdate extends SqlDataUpdate { * @param $title Title of the page we're updating * @param $parserOutput ParserOutput: output from a full parse of this page * @param $recursive Boolean: queue jobs for recursive updates? + * @throws MWException */ function __construct( $title, $parserOutput, $recursive = true ) { parent::__construct( false ); // no implicit transaction diff --git a/includes/LocalisationCache.php b/includes/LocalisationCache.php index d8e5d3a368..e88c240837 100644 --- a/includes/LocalisationCache.php +++ b/includes/LocalisationCache.php @@ -168,6 +168,7 @@ class LocalisationCache { * for $wgLocalisationCacheConf. * * @param $conf Array + * @throws MWException */ function __construct( $conf ) { global $wgCacheDirectory; @@ -404,6 +405,7 @@ class LocalisationCache { /** * Initialise a language in this object. Rebuild the cache if necessary. * @param $code + * @throws MWException */ protected function initLanguage( $code ) { if ( isset( $this->initialisedLangs[$code] ) ) { @@ -474,6 +476,7 @@ class LocalisationCache { * Read a PHP file containing localisation data. * @param $_fileName * @param $_fileType + * @throws MWException * @return array */ protected function readPHPFile( $_fileName, $_fileType ) { @@ -659,6 +662,7 @@ class LocalisationCache { * Load localisation data for a given language for both core and extensions * and save it to the persistent cache store and the process cache * @param $code + * @throws MWException */ public function recache( $code ) { global $wgExtensionMessagesFiles; diff --git a/includes/Message.php b/includes/Message.php index 99e60108f3..824f1771fe 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -337,6 +337,7 @@ class Message { * turned off. * @since 1.17 * @param $lang Mixed: language code or Language object. + * @throws MWException * @return Message: $this */ public function inLanguage( $lang ) { @@ -644,6 +645,7 @@ class Message { /** * Wrapper for what ever method we use to get message contents * @since 1.17 + * @throws MWException * @return string */ protected function fetchMessage() { diff --git a/includes/MessageBlobStore.php b/includes/MessageBlobStore.php index 34014e1b31..3a698e5bc5 100644 --- a/includes/MessageBlobStore.php +++ b/includes/MessageBlobStore.php @@ -311,6 +311,7 @@ class MessageBlobStore { * @param $resourceLoader ResourceLoader object * @param $modules Array of module names * @param $lang String: language code + * @throws MWException * @return array Array mapping module names to blobs */ private static function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) { diff --git a/includes/Namespace.php b/includes/Namespace.php index 866e468bc8..e8d5632d88 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -48,6 +48,7 @@ class MWNamespace { * @param $index * @param $method * + * @throws MWException * @return bool */ private static function isMethodValidFor( $index, $method ) { diff --git a/includes/OutputPage.php b/includes/OutputPage.php index f0fd067c78..ea90250eac 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1570,9 +1570,10 @@ class OutputPage extends ContextSource { * @param $interface Boolean: use interface language ($wgLang instead of * $wgContLang) while parsing language sensitive magic * words like GRAMMAR and PLURAL. This also disables - * LanguageConverter. + * LanguageConverter. * @param $language Language object: target language object, will override * $interface + * @throws MWException * @return String: HTML */ public function parse( $text, $linestart = true, $interface = false, $language = null ) { @@ -2155,6 +2156,7 @@ class OutputPage extends ContextSource { * Display an error page noting that a given permission bit is required. * @deprecated since 1.18, just throw the exception directly * @param $permission String: key required + * @throws PermissionsError */ public function permissionRequired( $permission ) { throw new PermissionsError( $permission ); @@ -2225,6 +2227,7 @@ class OutputPage extends ContextSource { * @param $protected Boolean: is this a permissions error? * @param $reasons Array: list of reasons for this error, as returned by Title::getUserPermissionsErrors(). * @param $action String: action that was denied or null if unknown + * @throws ReadOnlyError */ public function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) { $this->setRobotPolicy( 'noindex,nofollow' ); diff --git a/includes/QueryPage.php b/includes/QueryPage.php index ac559dc5fc..1f21584080 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -151,6 +151,7 @@ abstract class QueryPage extends SpecialPage { /** * For back-compat, subclasses may return a raw SQL query here, as a string. * This is stronly deprecated; getQueryInfo() should be overridden instead. + * @throws MWException * @return string */ function getSQL() { diff --git a/includes/Revision.php b/includes/Revision.php index 2cd3ae83e3..40e7734ea2 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -139,6 +139,7 @@ class Revision implements IDBAccessObject { * @param $row * @param $overrides array * + * @throws MWException * @return Revision */ public static function newFromArchiveRow( $row, $overrides = array() ) { @@ -459,6 +460,7 @@ class Revision implements IDBAccessObject { * Constructor * * @param $row Mixed: either a database row or an array + * @throws MWException * @access private */ function __construct( $row ) { @@ -1220,6 +1222,7 @@ class Revision implements IDBAccessObject { * number on success and dies horribly on failure. * * @param $dbw DatabaseBase: (master connection) + * @throws MWException * @return Integer */ public function insertOn( $dbw ) { diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 6358540c6f..8919f10ad6 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -1183,6 +1183,7 @@ class Sanitizer { * attribs regex matches. * * @param $set Array + * @throws MWException * @return String */ private static function getTagAttributeCallback( $set ) { diff --git a/includes/Skin.php b/includes/Skin.php index 9bee8a2735..24d48bc44c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1536,6 +1536,7 @@ abstract class Skin extends ContextSource { * * @param $fname String Name of called method * @param $args Array Arguments to the method + * @throws MWException * @return mixed */ function __call( $fname, $args ) { diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c6547473cb..6233228d37 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -503,6 +503,7 @@ class SkinTemplate extends Skin { * By default it is capitalized. * * @param $name string Language name, e.g. "English" or "español" + * @return string * @private */ function formatLanguageName( $name ) { diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 09683a2439..a72c1af566 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -254,6 +254,7 @@ class SpecialPage { * * @param $name String * @param $subpage String|Bool subpage string, or false to not use a subpage + * @throws MWException * @return Title object */ public static function getTitleFor( $name, $subpage = false ) { @@ -350,6 +351,7 @@ class SpecialPage { * * @param $fName String Name of called method * @param $a Array Arguments to the method + * @throws MWException * @deprecated since 1.17, call parent::__construct() */ public function __call( $fName, $a ) { @@ -931,8 +933,8 @@ abstract class FormSpecialPage extends SpecialPage { * Called from execute() to check if the given user can perform this action. * Failures here must throw subclasses of ErrorPageError. * @param $user User + * @throws UserBlockedError * @return Bool true - * @throws ErrorPageError */ protected function checkExecutePermissions( User $user ) { $this->checkPermissions(); diff --git a/includes/StreamFile.php b/includes/StreamFile.php index 95c69a20b6..b0e6c12ec2 100644 --- a/includes/StreamFile.php +++ b/includes/StreamFile.php @@ -35,6 +35,7 @@ class StreamFile { * @param $fname string Full name and path of the file to stream * @param $headers array Any additional headers to send * @param $sendErrors bool Send error messages if errors occur (like 404) + * @throws MWException * @return bool Success */ public static function stream( $fname, $headers = array(), $sendErrors = true ) { diff --git a/includes/StubObject.php b/includes/StubObject.php index 615bcb5f97..cc0adb743d 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -108,6 +108,7 @@ class StubObject { * @param $name String: name of the method called in this object. * @param $level Integer: level to go in the stact trace to get the function * who called this function. + * @throws MWException */ function _unstub( $name = '_unstub', $level = 2 ) { static $recursionLevel = 0; diff --git a/includes/User.php b/includes/User.php index 4332e2bddf..93a6835d3a 100644 --- a/includes/User.php +++ b/includes/User.php @@ -765,6 +765,7 @@ class User { * - 'usable' Valid for batch processes and login * - 'creatable' Valid for batch processes, login and account creation * + * @throws MWException * @return bool|string */ public static function getCanonicalName( $name, $validate = 'valid' ) { diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 5d5ed8552c..9830f69578 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -152,6 +152,7 @@ class UserMailer { * @param $body String: email's text. * @param $replyto MailAddress: optional reply-to email (default: null). * @param $contentType String: optional custom Content-Type (default: text/plain; charset=UTF-8) + * @throws MWException * @return Status object */ public static function send( $to, $from, $subject, $body, $replyto = null, $contentType = 'text/plain; charset=UTF-8' ) { diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 2cc6338b96..80fb81a5f8 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -620,6 +620,7 @@ class WebRequest { * Return the path and query string portion of the request URI. * This will be suitable for use as a relative link in HTML output. * + * @throws MWException * @return String */ public function getRequestURL() { @@ -907,6 +908,7 @@ class WebRequest { * false if an error message has been shown and the request should be aborted. * * @param $extWhitelist array + * @throws HttpError * @return bool */ public function checkUrlExtension( $extWhitelist = array() ) { @@ -1056,9 +1058,10 @@ HTML; /** * Work out the IP address based on various globals * For trusted proxies, use the XFF client IP (first of the chain) - * + * * @since 1.19 * + * @throws MWException * @return string */ public function getIP() { @@ -1238,6 +1241,7 @@ class FauxRequest extends WebRequest { * fake GET/POST values * @param $wasPosted Bool: whether to treat the data as POST * @param $session Mixed: session array or null + * @throws MWException */ public function __construct( $data = array(), $wasPosted = false, $session = null ) { if( is_array( $data ) ) { diff --git a/includes/Wiki.php b/includes/Wiki.php index e1d84d4559..e6ccbe5a40 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -169,6 +169,7 @@ class MediaWiki { * - special pages * - normal pages * + * @throws MWException|PermissionsError|BadTitleError|HttpError * @return void */ private function performRequest() { diff --git a/includes/Xml.php b/includes/Xml.php index 4a55d5e7ce..35019ff9f9 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -59,6 +59,7 @@ class Xml { * The values are passed to Sanitizer::encodeAttribute. * Return null if no attributes given. * @param $attribs Array of attributes for an XML element + * @throws MWException * @return null|string */ public static function expandAttributes( $attribs ) { diff --git a/includes/ZipDirectoryReader.php b/includes/ZipDirectoryReader.php index 3a7c27ad76..ccdf2bb110 100644 --- a/includes/ZipDirectoryReader.php +++ b/includes/ZipDirectoryReader.php @@ -596,6 +596,7 @@ class ZipDirectoryReader { * * @param $offset int The offset into the string at which to start unpacking. * + * @throws MWException * @return array Unpacked associative array. Note that large integers in the input * may be represented as floating point numbers in the return value, so * the use of weak comparison is advised. diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 468e21beec..a4b0cb7a29 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -145,6 +145,8 @@ class InfoAction extends FormlessAction { * Returns page information in an easily-manipulated format. Array keys are used so extensions * may add additional information in arbitrary positions. Array values are arrays with one * element to be rendered as a header, arrays with two elements to be rendered as a table row. + * + * @return array */ protected function pageInfo() { global $wgContLang, $wgDisableCounters, $wgRCMaxAge; diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index 6bfeed32b1..fca071a120 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -33,6 +33,7 @@ class HTMLFileCache extends FileCacheBase { * Construct an ObjectFileCache from a Title and an action * @param $title Title|string Title object or prefixed DB key string * @param $action string + * @throws MWException * @return HTMLFileCache */ public static function newFromTitle( $title, $action ) { diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index af380506ea..e061101bc6 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -596,7 +596,7 @@ class MessageCache { * @param $key String: the message cache key * @param $useDB Boolean: get the message from the DB, false to use only * the localisation - * @param $langcode String: code of the language to get the message for, if + * @param bool|string $langcode Code of the language to get the message for, if * it is a valid code create a language for that language, * if it is a string but not a valid code then make a basic * language object, if it is a false boolean then use the @@ -607,6 +607,7 @@ class MessageCache { * @param $isFullKey Boolean: specifies whether $key is a two part key * "msg/lang". * + * @throws MWException * @return string|bool */ function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { diff --git a/includes/conf/Conf.php b/includes/conf/Conf.php index 93204ead73..22c621fe5a 100644 --- a/includes/conf/Conf.php +++ b/includes/conf/Conf.php @@ -97,6 +97,7 @@ abstract class Conf { * Initialize a new child class based on a configuration array * @param $conf Array of configuration settings, see $wgConfiguration * for details + * @throws MWException * @return Conf */ private static function newFromSettings( $conf ) { @@ -109,7 +110,8 @@ abstract class Conf { /** * Get the singleton if we don't want a specific wiki - * @param $wiki String An id for a remote wiki + * @param bool|string $wiki An id for a remote wiki + * @throws MWException * @return Conf child */ public static function load( $wiki = false ) { diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index 5adf3621b3..a4e327267f 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -222,6 +222,7 @@ class DerivativeContext extends ContextSource { * Set the Language object * * @param $l Mixed Language instance or language code + * @throws MWException * @since 1.19 */ public function setLanguage( $l ) { diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 1ffbc08ce2..a528f22cc0 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -148,6 +148,7 @@ class RequestContext implements IContextSource { * canUseWikiPage() to check whether this method can be called safely. * * @since 1.19 + * @throws MWException * @return WikiPage */ public function getWikiPage() { @@ -237,6 +238,7 @@ class RequestContext implements IContextSource { * Set the Language object * * @param $l Mixed Language instance or language code + * @throws MWException * @since 1.19 */ public function setLanguage( $l ) { diff --git a/includes/db/Database.php b/includes/db/Database.php index 141a324f62..465f25dd34 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -781,6 +781,7 @@ abstract class DatabaseBase implements DatabaseType { /** * @param $error String: fallback error message, used if none is given by DB + * @throws DBConnectionError */ function reportConnectionError( $error = 'Unknown error' ) { $myError = $this->lastError(); @@ -830,9 +831,9 @@ 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? + * @throws MWException * @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 */ public function query( $sql, $fname = '', $tempIgnore = false ) { $isMaster = !is_null( $this->getLBInfo( 'master' ) ); @@ -961,6 +962,7 @@ abstract class DatabaseBase implements DatabaseType { * @param $sql String * @param $fname String * @param $tempIgnore Boolean + * @throws DBQueryError */ public function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) { # Ignore errors during error handling to avoid infinite recursion @@ -1047,6 +1049,7 @@ abstract class DatabaseBase implements DatabaseType { * while we're doing this. * * @param $matches Array + * @throws DBUnexpectedError * @return String */ protected function fillPreparedArg( $matches ) { @@ -1762,7 +1765,7 @@ abstract class DatabaseBase implements DatabaseType { /** * Makes an encoded list of strings from an array * @param $a Array containing the data - * @param $mode int Constant + * @param int $mode Constant * - LIST_COMMA: comma separated, no field names * - LIST_AND: ANDed WHERE clause (without the WHERE). See * the documentation for $conds in DatabaseBase::select(). @@ -1770,6 +1773,7 @@ abstract class DatabaseBase implements DatabaseType { * - LIST_SET: comma separated with field names, like a SET clause * - LIST_NAMES: comma separated field names * + * @throws MWException|DBUnexpectedError * @return string */ public function makeList( $a, $mode = LIST_COMMA ) { @@ -2471,6 +2475,7 @@ abstract class DatabaseBase implements DatabaseType { * ANDed together in the WHERE clause * @param $fname String: Calling function name (use __METHOD__) for * logs/profiling + * @throws DBUnexpectedError */ public function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = 'DatabaseBase::deleteJoin' ) @@ -2536,6 +2541,7 @@ abstract class DatabaseBase implements DatabaseType { * the format. Use $conds == "*" to delete all rows * @param $fname String name of the calling function * + * @throws DBUnexpectedError * @return bool */ public function delete( $table, $conds, $fname = 'DatabaseBase::delete' ) { @@ -2634,6 +2640,7 @@ abstract class DatabaseBase implements DatabaseType { * @param $limit Integer the SQL limit * @param $offset Integer|bool the SQL offset (default false) * + * @throws DBUnexpectedError * @return string */ public function limitResult( $sql, $limit, $offset = false ) { @@ -3042,6 +3049,7 @@ abstract class DatabaseBase implements DatabaseType { * @param $newName String: name of table to be created * @param $temporary Boolean: whether the new table should be temporary * @param $fname String: calling function name + * @throws MWException * @return Boolean: true if operation was successful */ public function duplicateTableStructure( $oldName, $newName, $temporary = false, @@ -3056,6 +3064,7 @@ abstract class DatabaseBase implements DatabaseType { * * @param $prefix string Only show tables with this prefix, e.g. mw_ * @param $fname String: calling function name + * @throws MWException */ function listTables( $prefix = null, $fname = 'DatabaseBase::listTables' ) { throw new MWException( 'DatabaseBase::listTables is not implemented in descendant class' ); @@ -3199,10 +3208,11 @@ abstract class DatabaseBase implements DatabaseType { * on object's error ignore settings). * * @param $filename String: File name to open - * @param $lineCallback Callback: Optional function called before reading each line - * @param $resultCallback Callback: Optional function called for each MySQL result - * @param $fname String: Calling function name or false if name should be + * @param bool|callable $lineCallback Optional function called before reading each line + * @param bool|callable $resultCallback Optional function called for each MySQL result + * @param bool|string $fname Calling function name or false if name should be * generated dynamically using $filename + * @throws MWException * @return bool|string */ public function sourceFile( diff --git a/includes/db/DatabaseIbm_db2.php b/includes/db/DatabaseIbm_db2.php index f1f6dfca58..62c90d174e 100644 --- a/includes/db/DatabaseIbm_db2.php +++ b/includes/db/DatabaseIbm_db2.php @@ -496,6 +496,7 @@ class DatabaseIbm_db2 extends DatabaseBase { * @param $user String * @param $password String * @param $dbName String: database name + * @throws DBConnectionError * @return DatabaseBase a fresh connection */ public function open( $server, $user, $password, $dbName ) { @@ -622,6 +623,7 @@ class DatabaseIbm_db2 extends DatabaseBase { /** * The DBMS-dependent part of query() * @param $sql String: SQL query. + * @throws DBUnexpectedError * @return object Result object for fetch functions or false on failure */ protected function doQuery( $sql ) { @@ -854,6 +856,9 @@ class DatabaseIbm_db2 extends DatabaseBase { * LIST_SET - comma separated with field names, like a SET clause * LIST_NAMES - comma separated field names * LIST_SET_PREPARED - like LIST_SET, except with ? tokens as values + * @param array $a + * @param int $mode + * @throws DBUnexpectedError * @return string */ function makeList( $a, $mode = LIST_COMMA ) { @@ -891,7 +896,8 @@ class DatabaseIbm_db2 extends DatabaseBase { * * @param $sql string SQL query we will append the limit too * @param $limit integer the SQL limit - * @param $offset integer the SQL offset (default false) + * @param bool|int $offset SQL offset (default false) + * @throws DBUnexpectedError * @return string */ public function limitResult( $sql, $limit, $offset=false ) { @@ -1173,6 +1179,10 @@ class DatabaseIbm_db2 extends DatabaseBase { * DELETE query wrapper * * Use $conds == "*" to delete all rows + * @param array $table + * @param array|string $conds + * @param string $fname + * @throws DBUnexpectedError * @return bool|\ResultWrapper */ public function delete( $table, $conds, $fname = 'DatabaseIbm_db2::delete' ) { @@ -1247,6 +1257,7 @@ class DatabaseIbm_db2 extends DatabaseBase { /** * Frees memory associated with a statement resource * @param $res Object: statement resource to free + * @throws DBUnexpectedError * @return Boolean success or failure */ public function freeResult( $res ) { diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 914ab4089a..ff67f47273 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -61,6 +61,11 @@ class DatabaseMssql extends DatabaseBase { /** * Usually aborts on failure + * @param String $server + * @param String $user + * @param String $password + * @param String $dbName + * @throws DBConnectionError * @return bool|DatabaseBase|null */ function open( $server, $user, $password, $dbName ) { @@ -380,6 +385,11 @@ class DatabaseMssql extends DatabaseBase { * * Usually aborts on failure * If errors are explicitly ignored, returns success + * @param String $table + * @param Array $arrToInsert + * @param string $fname + * @param array $options + * @throws DBQueryError * @return bool */ function insert( $table, $arrToInsert, $fname = 'DatabaseMssql::insert', $options = array() ) { @@ -510,6 +520,14 @@ class DatabaseMssql extends DatabaseBase { * Source items may be literals rather than field names, but strings should be quoted with Database::addQuotes() * $conds may be "*" to copy the whole table * srcTable may be an array of tables. + * @param string $destTable + * @param array|string $srcTable + * @param array $varMap + * @param array $conds + * @param string $fname + * @param array $insertOptions + * @param array $selectOptions + * @throws DBQueryError * @return null|\ResultWrapper */ function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabaseMssql::insertSelect', @@ -720,6 +738,8 @@ class DatabaseMssql extends DatabaseBase { * Escapes a identifier for use inm SQL. * Throws an exception if it is invalid. * Reference: http://msdn.microsoft.com/en-us/library/aa224033%28v=SQL.80%29.aspx + * @param $identifier + * @throws MWException * @return string */ private function escapeIdentifier( $identifier ) { diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 50ae993c8b..b509302fc5 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -805,7 +805,8 @@ class DatabaseMysql extends DatabaseBase { * @param $delVar string * @param $joinVar string * @param $conds array|string - * @param $fname bool + * @param bool|string $fname bool + * @throws DBUnexpectedError * @return bool|ResultWrapper */ function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = 'DatabaseBase::deleteJoin' ) { diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 7d8884fb6b..aa4da0fedf 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -241,6 +241,11 @@ class DatabaseOracle extends DatabaseBase { /** * Usually aborts on failure + * @param string $server + * @param string $user + * @param string $password + * @param string $dbName + * @throws DBConnectionError * @return DatabaseBase|null */ function open( $server, $user, $password, $dbName ) { diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 457bf384a8..419488e595 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -325,6 +325,11 @@ class DatabasePostgres extends DatabaseBase { /** * Usually aborts on failure + * @param string $server + * @param string $user + * @param string $password + * @param string $dbName + * @throws DBConnectionError * @return DatabaseBase|null */ function open( $server, $user, $password, $dbName ) { diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index f1e553d736..1125d4f37a 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -79,11 +79,12 @@ class DatabaseSqlite extends DatabaseBase { /** Open an SQLite database and return a resource handle to it * NOTE: only $dbName is used, the other parameters are irrelevant for SQLite databases * - * @param $server - * @param $user - * @param $pass - * @param $dbName + * @param string $server + * @param string $user + * @param string $pass + * @param string $dbName * + * @throws DBConnectionError * @return PDO */ function open( $server, $user, $pass, $dbName ) { @@ -103,6 +104,7 @@ class DatabaseSqlite extends DatabaseBase { * * @param $fileName string * + * @throws DBConnectionError * @return PDO|bool SQL connection or false if failed */ function openFile( $fileName ) { diff --git a/includes/db/LBFactory_Multi.php b/includes/db/LBFactory_Multi.php index 6008813ba1..9b468a7f7f 100644 --- a/includes/db/LBFactory_Multi.php +++ b/includes/db/LBFactory_Multi.php @@ -70,6 +70,7 @@ class LBFactory_Multi extends LBFactory { /** * @param $conf array + * @throws MWException */ function __construct( $conf ) { $this->chronProt = new ChronologyProtector; @@ -153,8 +154,9 @@ class LBFactory_Multi extends LBFactory { } /** - * @param $cluster - * @param $wiki + * @param String $cluster + * @param bool $wiki + * @throws MWException * @return LoadBalancer */ function newExternalLB( $cluster, $wiki = false ) { diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 195d4ec417..e66923fff0 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -41,6 +41,7 @@ class LoadBalancer { * servers Required. Array of server info structures. * masterWaitTimeout Replication lag wait timeout * loadMonitor Name of a class used to fetch server lag and load. + * @throws MWException */ function __construct( $params ) { if ( !isset( $params['servers'] ) ) { @@ -197,6 +198,7 @@ class LoadBalancer { * Side effect: opens connections to databases * @param $group bool * @param $wiki bool + * @throws MWException * @return bool|int|string */ function getReaderIndex( $group = false, $wiki = false ) { @@ -452,8 +454,9 @@ class LoadBalancer { * * @param $i Integer: server index * @param $groups Array: query groups - * @param $wiki String: wiki ID + * @param bool|string $wiki Wiki ID * + * @throws MWException * @return DatabaseBase */ public function &getConnection( $i, $groups = array(), $wiki = false ) { @@ -520,6 +523,7 @@ class LoadBalancer { * the same number of times as getConnection() to work. * * @param DatabaseBase $conn + * @throws MWException */ public function reuseConnection( $conn ) { $serverIndex = $conn->getLBInfo('serverIndex'); @@ -692,6 +696,7 @@ class LoadBalancer { * * @param $server * @param $dbNameOverride bool + * @throws MWException * @return DatabaseBase */ function reallyOpenConnection( $server, $dbNameOverride = false ) { diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index c10d1057a5..1136fc2816 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -1177,6 +1177,7 @@ abstract class FileBackend { * * @param $type string One of (attachment, inline) * @param $filename string Suggested file name (should not contain slashes) + * @throws MWException * @return string * @since 1.20 */ diff --git a/includes/filebackend/FileBackendMultiWrite.php b/includes/filebackend/FileBackendMultiWrite.php index e62cdaa6e3..90292ee027 100644 --- a/includes/filebackend/FileBackendMultiWrite.php +++ b/includes/filebackend/FileBackendMultiWrite.php @@ -536,6 +536,7 @@ class FileBackendMultiWrite extends FileBackend { /** * @see FileBackend::fileExists() * @param $params array + * @return bool|null */ public function fileExists( array $params ) { $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] ); diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index a29816f068..440359de5a 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -1176,6 +1176,8 @@ abstract class FileBackendStore extends FileBackend { /** * @see FileBackendStore::executeOpHandlesInternal() + * @param array $fileOpHandles + * @throws MWException * @return Array List of corresponding Status objects */ protected function doExecuteOpHandlesInternal( array $fileOpHandles ) { diff --git a/includes/filebackend/lockmanager/MemcLockManager.php b/includes/filebackend/lockmanager/MemcLockManager.php index 57c0463d4c..26a5e2da8e 100644 --- a/includes/filebackend/lockmanager/MemcLockManager.php +++ b/includes/filebackend/lockmanager/MemcLockManager.php @@ -64,6 +64,7 @@ class MemcLockManager extends QuorumLockManager { * - wikiId : Wiki ID string that all resources are relative to. [optional] * * @param Array $config + * @throws MWException */ public function __construct( array $config ) { parent::__construct( $config ); diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 5f24fedc13..e8aa5a6335 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -1318,6 +1318,7 @@ class FileRepo { * e.g. s/z/a/ for sza251lrxrc1jad41h5mgilp8nysje52.jpg * * @param $key string + * @throws MWException * @return string */ public function getDeletedHashPath( $key ) { diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index c5a0bd1b48..c9751bec29 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -108,6 +108,7 @@ class ArchivedFile { /** * Loads a file object from the filearchive table + * @throws MWException * @return bool|null True on success or null */ public function load() { diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 3ac2b3a8d2..882ec5323a 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -190,6 +190,7 @@ class PostgresInstaller extends DatabaseInstaller { * other similar objects in the new DB. * - create-tables: A connection with a role suitable for creating tables. * + * @throws MWException * @return Status object. On success, a connection object will be in the * value member. */ diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 7586bb6548..7d94a30bd4 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -429,6 +429,7 @@ class LogFormatter { * value in consideration. * @param $title Title the page * @param $parameters array query parameters + * @throws MWException * @return String */ protected function makePageLink( Title $title = null, $parameters = array() ) { diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 99ac854ba1..ca9b6363cb 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -623,7 +623,8 @@ class BitmapHandler extends ImageHandler { * to filter down to users. * * @param $path string The file path - * @param $scene string The scene specification, or false if there is none + * @param bool|string $scene The scene specification, or false if there is none + * @throws MWException * @return string */ function escapeMagickInput( $path, $scene = false ) { @@ -654,7 +655,8 @@ class BitmapHandler extends ImageHandler { * helper function for escapeMagickInput() and escapeMagickOutput(). * * @param $path string The file path - * @param $scene string The scene specification, or false if there is none + * @param bool|string $scene The scene specification, or false if there is none + * @throws MWException * @return string */ protected function escapeMagickPath( $path, $scene = false ) { diff --git a/includes/media/BitmapMetadataHandler.php b/includes/media/BitmapMetadataHandler.php index 0a195547eb..d2edc9f140 100644 --- a/includes/media/BitmapMetadataHandler.php +++ b/includes/media/BitmapMetadataHandler.php @@ -257,6 +257,7 @@ class BitmapMetadataHandler { * * The various exceptions this throws are caught later. * @param $filename String + * @throws MWException * @return Array The metadata. */ static public function Tiff ( $filename ) { diff --git a/includes/media/Exif.php b/includes/media/Exif.php index 784a6018c0..104ba555f6 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -104,6 +104,7 @@ class Exif { * * @param $file String: filename. * @param $byteOrder String Type of byte ordering either 'BE' (Big Endian) or 'LE' (Little Endian). Default ''. + * @throws MWException * @todo FIXME: The following are broke: * SubjectArea. Need to test the more obscure tags. * diff --git a/includes/media/GIFMetadataExtractor.php b/includes/media/GIFMetadataExtractor.php index 5fc5c1a717..f6ca7753d3 100644 --- a/includes/media/GIFMetadataExtractor.php +++ b/includes/media/GIFMetadataExtractor.php @@ -260,6 +260,7 @@ class GIFMetadataExtractor { /** * @param $data + * @throws Exception * @return int */ static function decodeBPP( $data ) { @@ -276,7 +277,7 @@ class GIFMetadataExtractor { /** * @param $fh - * @return + * @throws Exception */ static function skipBlock( $fh ) { while ( !feof( $fh ) ) { @@ -290,6 +291,7 @@ class GIFMetadataExtractor { fread( $fh, $block_len ); } } + /** * Read a block. In the GIF format, a block is made up of * several sub-blocks. Each sub block starts with one byte @@ -301,6 +303,7 @@ class GIFMetadataExtractor { * sub-blocks in the returned value. Normally this is false, * except XMP is weird and does a hack where you need to keep * these length bytes. + * @throws Exception * @return string The data. */ static function readBlock( $fh, $includeLengths = false ) { diff --git a/includes/media/JpegMetadataExtractor.php b/includes/media/JpegMetadataExtractor.php index 8d7e43b905..ecf216ad53 100644 --- a/includes/media/JpegMetadataExtractor.php +++ b/includes/media/JpegMetadataExtractor.php @@ -165,10 +165,11 @@ class JpegMetadataExtractor { } /** - * Helper function for jpegSegmentSplitter - * @param &$fh FileHandle for jpeg file - * @return string data content of segment. - */ + * Helper function for jpegSegmentSplitter + * @param &$fh FileHandle for jpeg file + * @throws MWException + * @return string data content of segment. + */ private static function jpegExtractMarker( &$fh ) { $size = wfUnpack( "nint", fread( $fh, 2 ), 2 ); if ( $size['int'] <= 2 ) { diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 773824cb60..c5e4566be6 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -281,6 +281,7 @@ class ThumbnailImage extends MediaTransformOutput { * For images, desc-link and file-link are implemented as a click-through. For * sounds and videos, they may be displayed in other ways. * + * @throws MWException * @return string */ function toHtml( $options = array() ) { diff --git a/includes/media/SVG.php b/includes/media/SVG.php index 55fa5547bf..75d474c0ab 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -135,14 +135,15 @@ class SvgHandler extends ImageHandler { } /** - * Transform an SVG file to PNG - * This function can be called outside of thumbnail contexts - * @param string $srcPath - * @param string $dstPath - * @param string $width - * @param string $height - * @return bool|MediaTransformError - */ + * Transform an SVG file to PNG + * This function can be called outside of thumbnail contexts + * @param string $srcPath + * @param string $dstPath + * @param string $width + * @param string $height + * @throws MWException + * @return bool|MediaTransformError + */ public function rasterize( $srcPath, $dstPath, $width, $height ) { global $wgSVGConverters, $wgSVGConverter, $wgSVGConverterPath; $err = false; diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index 851fe428a6..871d419e48 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -52,6 +52,7 @@ class SVGReader { * * Creates an SVGReader drawing from the source provided * @param $source String: URI from which to read + * @throws MWException|Exception */ function __construct( $source ) { global $wgSVGMetadataCutoff; @@ -113,6 +114,7 @@ class SVGReader { /** * Read the SVG + * @throws MWException * @return bool */ public function read() { @@ -196,6 +198,7 @@ class SVGReader { * Read an XML snippet from an element * * @param String $metafield that we will fill with the result + * @throws MWException */ private function readXml( $metafield=null ) { $this->debug ( "Read top level metadata" ); diff --git a/includes/media/Tiff.php b/includes/media/Tiff.php index d95c907400..55dff77b07 100644 --- a/includes/media/Tiff.php +++ b/includes/media/Tiff.php @@ -70,8 +70,9 @@ class TiffHandler extends ExifBitmapHandler { } /** - * @param $image - * @param $filename + * @param File $image + * @param string $filename + * @throws MWException * @return string */ function getMetadata( $image, $filename ) { diff --git a/includes/media/XMP.php b/includes/media/XMP.php index 36660b3dcc..c5743d7286 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -232,17 +232,18 @@ class XMPReader { } /** - * Main function to call to parse XMP. Use getResults to - * get results. - * - * Also catches any errors during processing, writes them to - * debug log, blanks result array and returns false. - * - * @param $content String: XMP data - * @param $allOfIt Boolean: If this is all the data (true) or if its split up (false). Default true - * @param $reset Boolean: does xml parser need to be reset. Default false - * @return Boolean success. - */ + * Main function to call to parse XMP. Use getResults to + * get results. + * + * Also catches any errors during processing, writes them to + * debug log, blanks result array and returns false. + * + * @param $content String: XMP data + * @param $allOfIt Boolean: If this is all the data (true) or if its split up (false). Default true + * @param $reset Boolean: does xml parser need to be reset. Default false + * @throws MWException + * @return Boolean success. + */ public function parse( $content, $allOfIt = true, $reset = false ) { if ( $reset ) { $this->resetXMLParser(); @@ -463,22 +464,23 @@ class XMPReader { } /** - * Hit a closing element in MODE_STRUCT, MODE_SEQ, MODE_BAG - * generally means we've finished processing a nested structure. - * resets some internal variables to indicate that. - * - * Note this means we hit the closing element not the "". - * - * @par For example, when processing: - * @code{,xml} - * 64 - * - * @endcode - * - * This method is called when we hit the "" tag. - * - * @param $elm String namespace . space . tag name. - */ + * Hit a closing element in MODE_STRUCT, MODE_SEQ, MODE_BAG + * generally means we've finished processing a nested structure. + * resets some internal variables to indicate that. + * + * Note this means we hit the closing element not the "". + * + * @par For example, when processing: + * @code{,xml} + * 64 + * + * @endcode + * + * This method is called when we hit the "" tag. + * + * @param $elm String namespace . space . tag name. + * @throws MWException + */ private function endElementNested( $elm ) { /* cur item must be the same as $elm, unless if in MODE_STRUCT @@ -528,23 +530,24 @@ class XMPReader { } /** - * Hit a closing element in MODE_LI (either rdf:Seq, or rdf:Bag ) - * Add information about what type of element this is. - * - * Note we still have to hit the outer "" - * - * @par For example, when processing: - * @code{,xml} - * 64 - * - * @endcode - * - * This method is called when we hit the "". - * (For comparison, we call endElementModeSimple when we - * hit the "") - * - * @param $elm String namespace . ' ' . element name - */ + * Hit a closing element in MODE_LI (either rdf:Seq, or rdf:Bag ) + * Add information about what type of element this is. + * + * Note we still have to hit the outer "" + * + * @par For example, when processing: + * @code{,xml} + * 64 + * + * @endcode + * + * This method is called when we hit the "". + * (For comparison, we call endElementModeSimple when we + * hit the "") + * + * @param $elm String namespace . ' ' . element name + * @throws MWException + */ private function endElementModeLi( $elm ) { list( $ns, $tag ) = explode( ' ', $this->curItem[0], 2 ); @@ -599,17 +602,18 @@ class XMPReader { } /** - * Handler for hitting a closing element. - * - * generally just calls a helper function depending on what - * mode we're in. - * - * Ignores the outer wrapping elements that are optional in - * xmp and have no meaning. - * - * @param $parser XMLParser - * @param $elm String namespace . ' ' . element name - */ + * Handler for hitting a closing element. + * + * generally just calls a helper function depending on what + * mode we're in. + * + * Ignores the outer wrapping elements that are optional in + * xmp and have no meaning. + * + * @param $parser XMLParser + * @param $elm String namespace . ' ' . element name + * @throws MWException + */ function endElement( $parser, $elm ) { if ( $elm === ( self::NS_RDF . ' RDF' ) || $elm === 'adobe:ns:meta/ xmpmeta' @@ -759,22 +763,23 @@ class XMPReader { } /** - * Handle an opening element when in MODE_SIMPLE - * - * This should not happen often. This is for if a simple element - * already opened has a child element. Could happen for a - * qualified element. - * - * For example: - * 0/10 - * Bar - * - * - * This method is called when processing the element - * - * @param $elm String namespace and tag names separated by space. - * @param $attribs Array Attributes of the element. - */ + * Handle an opening element when in MODE_SIMPLE + * + * This should not happen often. This is for if a simple element + * already opened has a child element. Could happen for a + * qualified element. + * + * For example: + * 0/10 + * Bar + * + * + * This method is called when processing the element + * + * @param $elm String namespace and tag names separated by space. + * @param $attribs Array Attributes of the element. + * @throws MWException + */ private function startElementModeSimple( $elm, $attribs ) { if ( $elm === self::NS_RDF . ' Description' ) { // If this value has qualifiers @@ -824,16 +829,17 @@ class XMPReader { } /** - * Starting an element when in MODE_INITIAL - * This usually happens when we hit an element inside - * the outer rdf:Description - * - * This is generally where most properties start. - * - * @param $ns String Namespace - * @param $tag String tag name (without namespace prefix) - * @param $attribs Array array of attributes - */ + * Starting an element when in MODE_INITIAL + * This usually happens when we hit an element inside + * the outer rdf:Description + * + * This is generally where most properties start. + * + * @param $ns String Namespace + * @param $tag String tag name (without namespace prefix) + * @param $attribs Array array of attributes + * @throws MWException + */ private function startElementModeInitial( $ns, $tag, $attribs ) { if ( $ns !== self::NS_RDF ) { @@ -877,23 +883,24 @@ class XMPReader { } /** - * Hit an opening element when in a Struct (MODE_STRUCT) - * This is generally for fields of a compound property. - * - * Example of a struct (abbreviated; flash has more properties): - * - * True - * 1 - * - * or: - * - * True - * 1 - * - * @param $ns String namespace - * @param $tag String tag name (no ns) - * @param $attribs Array array of attribs w/ values. - */ + * Hit an opening element when in a Struct (MODE_STRUCT) + * This is generally for fields of a compound property. + * + * Example of a struct (abbreviated; flash has more properties): + * + * True + * 1 + * + * or: + * + * True + * 1 + * + * @param $ns String namespace + * @param $tag String tag name (no ns) + * @param $attribs Array array of attribs w/ values. + * @throws MWException + */ private function startElementModeStruct( $ns, $tag, $attribs ) { if ( $ns !== self::NS_RDF ) { @@ -1015,14 +1022,15 @@ class XMPReader { } /** - * Hits an opening element. - * Generally just calls a helper based on what MODE we're in. - * Also does some initial set up for the wrapper element - * - * @param $parser XMLParser - * @param $elm String namespace "" element - * @param $attribs Array attribute name => value - */ + * Hits an opening element. + * Generally just calls a helper based on what MODE we're in. + * Also does some initial set up for the wrapper element + * + * @param $parser XMLParser + * @param $elm String namespace "" element + * @param $attribs Array attribute name => value + * @throws MWException + */ function startElement( $parser, $elm, $attribs ) { if ( $elm === self::NS_RDF . ' RDF' @@ -1100,19 +1108,20 @@ class XMPReader { } /** - * Process attributes. - * Simple values can be stored as either a tag or attribute - * - * Often the initial "" tag just has all the simple - * properties as attributes. - * - * @par Example: - * @code - * - * @endcode - * - * @param $attribs Array attribute=>value array. - */ + * Process attributes. + * Simple values can be stored as either a tag or attribute + * + * Often the initial "" tag just has all the simple + * properties as attributes. + * + * @par Example: + * @code + * + * @endcode + * + * @param $attribs Array attribute=>value array. + * @throws MWException + */ private function doAttribs( $attribs ) { // first check for rdf:parseType attribute, as that can change diff --git a/includes/objectcache/EhcacheBagOStuff.php b/includes/objectcache/EhcacheBagOStuff.php index f86cf1575a..156c39ec02 100644 --- a/includes/objectcache/EhcacheBagOStuff.php +++ b/includes/objectcache/EhcacheBagOStuff.php @@ -35,6 +35,7 @@ class EhcacheBagOStuff extends BagOStuff { /** * @param $params array + * @throws MWException */ function __construct( $params ) { if ( !defined( 'CURLOPT_TIMEOUT_MS' ) ) { diff --git a/includes/objectcache/RedisBagOStuff.php b/includes/objectcache/RedisBagOStuff.php index d5de044607..40784f547c 100644 --- a/includes/objectcache/RedisBagOStuff.php +++ b/includes/objectcache/RedisBagOStuff.php @@ -321,6 +321,8 @@ class RedisBagOStuff extends BagOStuff { * Get a connection to the server with the specified name. Connections * are cached, and failures are persistent to avoid multiple timeouts. * + * @param $server + * @throws MWException * @return Redis object, or false on failure */ protected function getConnectionToServer( $server ) { diff --git a/includes/parser/CoreTagHooks.php b/includes/parser/CoreTagHooks.php index 296be66f5b..6505183958 100644 --- a/includes/parser/CoreTagHooks.php +++ b/includes/parser/CoreTagHooks.php @@ -72,6 +72,7 @@ class CoreTagHooks { * @param $content string * @param $attributes array * @param $parser Parser + * @throws MWException * @return array */ static function html( $content, $attributes, $parser ) { diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 1902443a1e..e1a2dd0e3a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -753,6 +753,7 @@ class Parser { * * @since 1.19 * + * @throws MWException * @return Language|null */ public function getTargetLanguage() { @@ -1531,6 +1532,7 @@ class Parser { * * @param $text string * + * @throws MWException * @return string */ function replaceExternalLinks( $text ) { @@ -1734,6 +1736,8 @@ class Parser { /** * Process [[ ]] wikilinks (RIL) + * @param $s + * @throws MWException * @return LinkHolderArray * * @private @@ -2451,6 +2455,7 @@ class Parser { * @param $str String the string to split * @param &$before String set to everything before the ':' * @param &$after String set to everything after the ':' + * @throws MWException * @return String the position of the ':', or false if none found */ function findColonNoLinks( $str, &$before, &$after ) { @@ -2615,8 +2620,9 @@ class Parser { * @private * * @param $index integer - * @param $frame PPFrame + * @param bool|\PPFrame $frame * + * @throws MWException * @return string */ function getVariableValue( $index, $frame = false ) { @@ -3125,6 +3131,7 @@ class Parser { * $piece['parts']: the parameter array * $piece['lineStart']: whether the brace was at the start of a line * @param $frame PPFrame The current frame, contains template arguments + * @throws MWException * @return String: the text of the template * @private */ @@ -3802,6 +3809,7 @@ class Parser { * noClose Original text did not have a close tag * @param $frame PPFrame * + * @throws MWException * @return string */ function extensionSubstitution( $params, $frame ) { @@ -4699,6 +4707,7 @@ class Parser { * * @param $tag Mixed: the tag to use, e.g. 'hook' for "" * @param $callback Mixed: the callback function (and object) to use for the tag + * @throws MWException * @return Mixed|null The old value of the mTagHooks array associated with the hook */ public function setHook( $tag, $callback ) { @@ -4729,6 +4738,7 @@ class Parser { * * @param $tag Mixed: the tag to use, e.g. 'hook' for "" * @param $callback Mixed: the callback function (and object) to use for the tag + * @throws MWException * @return Mixed|null The old value of the mTagHooks array associated with the hook */ function setTransparentTagHook( $tag, $callback ) { @@ -4791,6 +4801,7 @@ class Parser { * Please read the documentation in includes/parser/Preprocessor.php for more information * about the methods available in PPFrame and PPNode. * + * @throws MWException * @return string|callback The old callback function for this name, if any */ public function setFunctionHook( $id, $callback, $flags = 0 ) { @@ -4838,6 +4849,10 @@ class Parser { * Create a tag function, e.g. "some stuff". * Unlike tag hooks, tag functions are parsed at preprocessor level. * Unlike parser functions, their content is not preprocessed. + * @param $tag + * @param $callback + * @param $flags + * @throws MWException * @return null */ function setFunctionTagHook( $tag, $callback, $flags ) { @@ -5801,6 +5816,7 @@ class Parser { * check whether it is still valid, by calling isValidHalfParsedText(). * * @param $data array Serialized data + * @throws MWException * @return String */ function unserializeHalfParsedText( $data ) { diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index 6a4ef0c552..e5beba814e 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -48,6 +48,7 @@ class ParserCache { * May be a memcached client or a BagOStuff derivative. * * @param $memCached Object + * @throws MWException */ protected function __construct( $memCached ) { if ( !$memCached ) { diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 3bf510f540..b6bcf63264 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -75,6 +75,8 @@ class ParserOutput extends CacheTime { /** * callback used by getText to replace editsection tokens * @private + * @param $m + * @throws MWException * @return mixed */ function replaceEditSectionLinksCallback( $m ) { diff --git a/includes/parser/Parser_LinkHooks.php b/includes/parser/Parser_LinkHooks.php index 6bcc324d58..9c750b8ce1 100644 --- a/includes/parser/Parser_LinkHooks.php +++ b/includes/parser/Parser_LinkHooks.php @@ -84,11 +84,11 @@ class Parser_LinkHooks extends Parser { * Create a link hook, e.g. [[Namepsace:...|display}} * The callback function should have the form: * function myLinkCallback( $parser, $holders, $markers, - * Title $title, $titleText, &$sortText = null, &$leadingColon = false ) { ... } + * Title $title, $titleText, &$sortText = null, &$leadingColon = false ) { ... } * * Or with SLH_PATTERN: * function myLinkCallback( $parser, $holders, $markers, ) - * &$titleText, &$sortText = null, &$leadingColon = false ) { ... } + * &$titleText, &$sortText = null, &$leadingColon = false ) { ... } * * The callback may either return a number of different possible values: * String) Text result of the link @@ -100,6 +100,7 @@ class Parser_LinkHooks extends Parser { * @param $flags Integer: a combination of the following flags: * SLH_PATTERN Use a regex link pattern rather than a namespace * + * @throws MWException * @return callback|null The old callback function for this name, if any */ public function setLinkHook( $ns, $callback, $flags = 0 ) { @@ -120,9 +121,11 @@ class Parser_LinkHooks extends Parser { function getLinkHooks() { return array_keys( $this->mLinkHooks ); } - + /** * Process [[ ]] wikilinks + * @param $s + * @throws MWException * @return LinkHolderArray * * @private diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 34de0ba541..15ea5e4b82 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -126,6 +126,7 @@ class Preprocessor_DOM implements Preprocessor { * cache may be implemented at a later date which takes further advantage of these strict * dependency requirements. * + * @throws MWException * @return PPNode_DOM */ function preprocessToObj( $text, $flags = 0 ) { @@ -1673,6 +1674,7 @@ class PPNode_DOM implements PPNode { * - index String index * - value PPNode value * + * @throws MWException * @return array */ function splitArg() { @@ -1694,6 +1696,7 @@ class PPNode_DOM implements PPNode { * Split an "" node into an associative array containing name, attr, inner and close * All values in the resulting array are PPNodes. Inner and close are optional. * + * @throws MWException * @return array */ function splitExt() { @@ -1719,6 +1722,7 @@ class PPNode_DOM implements PPNode { /** * Split a "" node + * @throws MWException * @return array */ function splitHeading() { diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 4f04c86502..a4e408e99d 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -105,6 +105,7 @@ class Preprocessor_Hash implements Preprocessor { * cache may be implemented at a later date which takes further advantage of these strict * dependency requirements. * + * @throws MWException * @return PPNode_Hash_Tree */ function preprocessToObj( $text, $flags = 0 ) { @@ -884,9 +885,11 @@ class PPFrame_Hash implements PPFrame { * Create a new child frame * $args is optionally a multi-root PPNode or array containing the template arguments * - * @param $args PPNode_Hash_Array|array + * @param array|bool|\PPNode_Hash_Array $args PPNode_Hash_Array|array * @param $title Title|bool * + * @param int $indexOffset + * @throws MWException * @return PPTemplateFrame_Hash */ function newChild( $args = false, $title = false, $indexOffset = 0 ) { @@ -1609,6 +1612,7 @@ class PPNode_Hash_Tree implements PPNode { * - index String index * - value PPNode value * + * @throws MWException * @return array */ function splitArg() { @@ -1642,6 +1646,7 @@ class PPNode_Hash_Tree implements PPNode { * Split an "" node into an associative array containing name, attr, inner and close * All values in the resulting array are PPNodes. Inner and close are optional. * + * @throws MWException * @return array */ function splitExt() { @@ -1669,6 +1674,7 @@ class PPNode_Hash_Tree implements PPNode { /** * Split an "" node * + * @throws MWException * @return array */ function splitHeading() { @@ -1695,6 +1701,7 @@ class PPNode_Hash_Tree implements PPNode { /** * Split a "