Update docs for return and exception info
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Sun, 7 Oct 2012 23:35:26 +0000 (01:35 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 9 Oct 2012 09:41:58 +0000 (09:41 +0000)
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190

100 files changed:
includes/Action.php
includes/Autopromote.php
includes/BacklinkCache.php
includes/Block.php
includes/Category.php
includes/CategoryViewer.php
includes/Cdb_PHP.php
includes/ChangeTags.php
includes/ConfEditor.php
includes/Cookie.php
includes/DataUpdate.php
includes/EditPage.php
includes/Export.php
includes/ExternalStore.php
includes/FileDeleteForm.php
includes/FormOptions.php
includes/GlobalFunctions.php
includes/HTMLForm.php
includes/HttpFunctions.php
includes/Import.php
includes/Linker.php
includes/LinksUpdate.php
includes/LocalisationCache.php
includes/Message.php
includes/MessageBlobStore.php
includes/Namespace.php
includes/OutputPage.php
includes/QueryPage.php
includes/Revision.php
includes/Sanitizer.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialPage.php
includes/StreamFile.php
includes/StubObject.php
includes/User.php
includes/UserMailer.php
includes/WebRequest.php
includes/Wiki.php
includes/Xml.php
includes/ZipDirectoryReader.php
includes/actions/InfoAction.php
includes/cache/HTMLFileCache.php
includes/cache/MessageCache.php
includes/conf/Conf.php
includes/context/DerivativeContext.php
includes/context/RequestContext.php
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMssql.php
includes/db/DatabaseMysql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/db/DatabaseSqlite.php
includes/db/LBFactory_Multi.php
includes/db/LoadBalancer.php
includes/filebackend/FileBackend.php
includes/filebackend/FileBackendMultiWrite.php
includes/filebackend/FileBackendStore.php
includes/filebackend/lockmanager/MemcLockManager.php
includes/filerepo/FileRepo.php
includes/filerepo/file/ArchivedFile.php
includes/installer/PostgresInstaller.php
includes/logging/LogFormatter.php
includes/media/Bitmap.php
includes/media/BitmapMetadataHandler.php
includes/media/Exif.php
includes/media/GIFMetadataExtractor.php
includes/media/JpegMetadataExtractor.php
includes/media/MediaTransformOutput.php
includes/media/SVG.php
includes/media/SVGMetadataExtractor.php
includes/media/Tiff.php
includes/media/XMP.php
includes/objectcache/EhcacheBagOStuff.php
includes/objectcache/RedisBagOStuff.php
includes/parser/CoreTagHooks.php
includes/parser/Parser.php
includes/parser/ParserCache.php
includes/parser/ParserOutput.php
includes/parser/Parser_LinkHooks.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/parser/Preprocessor_HipHop.hphp
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/revisiondelete/RevisionDeleteAbstracts.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialPasswordReset.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUploadStash.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialUserrights.php
includes/upload/UploadStash.php
languages/utils/CLDRPluralRuleEvaluator.php
maintenance/language/checkLanguage.inc
maintenance/locking/LockServerDaemon.php
maintenance/sqlite.inc

index 5192225..19552bc 100644 (file)
@@ -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 ) {
index 9c77855..d7ed2f9 100644 (file)
@@ -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 ) {
index d2055dd..ba8691b 100644 (file)
@@ -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 ) {
index 732699d..86b4d13 100644 (file)
@@ -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() {
index b7b12e8..ffd7bb8 100644 (file)
@@ -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() {
index 3bb2bc9..3d66b74 100644 (file)
@@ -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 ) {
index 02be65f..c97cf13 100644 (file)
@@ -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 );
index a97cb03..18f425a 100644 (file)
@@ -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 ) {
index b68fc76..d304e65 100644 (file)
@@ -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 ) {
index 7984d63..1b86f5d 100644 (file)
@@ -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;
index 377b64c..088bb7e 100644 (file)
@@ -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
index 1ae7f11..35328f8 100644 (file)
@@ -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() {
index 348b347..e2b01b5 100644 (file)
@@ -1347,6 +1347,7 @@ class DumpNamespaceFilter extends DumpFilter {
        /**
         * @param $sink DumpOutput
         * @param $param
+        * @throws MWException
         */
        function __construct( &$sink, $param ) {
                parent::__construct( $sink );
index 26e456c..1b7c29d 100644 (file)
@@ -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;
index 7e616b2..e2fcd9c 100644 (file)
@@ -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 ) {
index 33bbd86..f978639 100644 (file)
@@ -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
         */
index 3bbf62f..3de25e7 100644 (file)
@@ -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;
index 5c00b9f..21011a4 100644 (file)
@@ -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;
index 8453e62..32f77dc 100644 (file)
@@ -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 ) ) {
index 2746382..c9b0997 100644 (file)
@@ -429,6 +429,7 @@ class WikiImporter {
 
        /**
         * Primary entry point
+        * @throws MWException
         * @return bool
         */
        public function doImport() {
index 97b03be..c17e2d1 100644 (file)
@@ -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;
index 2b46260..fd1fefb 100644 (file)
@@ -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
index d8e5d3a..e88c240 100644 (file)
@@ -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;
index 99e6010..824f177 100644 (file)
@@ -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() {
index 34014e1..3a698e5 100644 (file)
@@ -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 ) {
index 866e468..e8d5632 100644 (file)
@@ -48,6 +48,7 @@ class MWNamespace {
         * @param $index
         * @param $method
         *
+        * @throws MWException
         * @return bool
         */
        private static function isMethodValidFor( $index, $method ) {
index f0fd067..ea90250 100644 (file)
@@ -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' );
index ac559dc..1f21584 100644 (file)
@@ -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() {
index 2cd3ae8..40e7734 100644 (file)
@@ -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 ) {
index 6358540..8919f10 100644 (file)
@@ -1183,6 +1183,7 @@ class Sanitizer {
         * attribs regex matches.
         *
         * @param $set Array
+        * @throws MWException
         * @return String
         */
        private static function getTagAttributeCallback( $set ) {
index 9bee8a2..24d48bc 100644 (file)
@@ -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 ) {
index c654747..6233228 100644 (file)
@@ -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 ) {
index 09683a2..a72c1af 100644 (file)
@@ -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();
index 95c69a2..b0e6c12 100644 (file)
@@ -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 ) {
index 615bcb5..cc0adb7 100644 (file)
@@ -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;
index 4332e2b..93a6835 100644 (file)
@@ -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' ) {
index 5d5ed85..9830f69 100644 (file)
@@ -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' ) {
index 2cc6338..80fb81a 100644 (file)
@@ -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 ) ) {
index e1d84d4..e6ccbe5 100644 (file)
@@ -169,6 +169,7 @@ class MediaWiki {
         * - special pages
         * - normal pages
         *
+        * @throws MWException|PermissionsError|BadTitleError|HttpError
         * @return void
         */
        private function performRequest() {
index 4a55d5e..35019ff 100644 (file)
@@ -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 ) {
index 3a7c27a..ccdf2bb 100644 (file)
@@ -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.
index 468e21b..a4b0cb7 100644 (file)
@@ -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;
index 6bfeed3..fca071a 100644 (file)
@@ -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 ) {
index af38050..e061101 100644 (file)
@@ -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 ) {
index 93204ea..22c621f 100644 (file)
@@ -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 ) {
index 5adf362..a4e3272 100644 (file)
@@ -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 ) {
index 1ffbc08..a528f22 100644 (file)
@@ -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 ) {
index 141a324..465f25d 100644 (file)
@@ -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(
index f1f6dfc..62c90d1 100644 (file)
@@ -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 ) {
index 914ab40..ff67f47 100644 (file)
@@ -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 ) {
index 50ae993..b509302 100644 (file)
@@ -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' ) {
index 7d8884f..aa4da0f 100644 (file)
@@ -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 ) {
index 457bf38..419488e 100644 (file)
@@ -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 ) {
index f1e553d..1125d4f 100644 (file)
@@ -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 ) {
index 6008813..9b468a7 100644 (file)
@@ -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 ) {
index 195d4ec..e66923f 100644 (file)
@@ -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 ) {
index c10d105..1136fc2 100644 (file)
@@ -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
         */
index e62cdaa..90292ee 100644 (file)
@@ -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] );
index a29816f..440359d 100644 (file)
@@ -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 ) {
index 57c0463..26a5e2d 100644 (file)
@@ -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 );
index 5f24fed..e8aa5a6 100644 (file)
@@ -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 ) {
index c5a0bd1..c9751be 100644 (file)
@@ -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() {
index 3ac2b3a..882ec53 100644 (file)
@@ -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.
         */
index 7586bb6..7d94a30 100644 (file)
@@ -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() ) {
index 99ac854..ca9b636 100644 (file)
@@ -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 ) {
index 0a19554..d2edc9f 100644 (file)
@@ -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 ) {
index 784a601..104ba55 100644 (file)
@@ -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.
         *
index 5fc5c1a..f6ca775 100644 (file)
@@ -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 ) {
index 8d7e43b..ecf216a 100644 (file)
@@ -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 ) {
index 773824c..c5e4566 100644 (file)
@@ -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() ) {
index 55fa554..75d474c 100644 (file)
@@ -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;
index 851fe42..871d419 100644 (file)
@@ -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" );
index d95c907..55dff77 100644 (file)
@@ -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 ) {
index 36660b3..c5743d7 100644 (file)
@@ -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 "</rdf:Seq>".
-       *
-       * @par For example, when processing:
-       * @code{,xml}
-       * <exif:ISOSpeedRatings> <rdf:Seq> <rdf:li>64</rdf:li>
-       *   </rdf:Seq> </exif:ISOSpeedRatings>
-       * @endcode
-       *
-       * This method is called when we hit the "</exif:ISOSpeedRatings>" 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 "</rdf:Seq>".
+        *
+        * @par For example, when processing:
+        * @code{,xml}
+        * <exif:ISOSpeedRatings> <rdf:Seq> <rdf:li>64</rdf:li>
+        *   </rdf:Seq> </exif:ISOSpeedRatings>
+        * @endcode
+        *
+        * This method is called when we hit the "</exif:ISOSpeedRatings>" 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 "</property>"
-       *
-       * @par For example, when processing:
-       * @code{,xml}
-       * <exif:ISOSpeedRatings> <rdf:Seq> <rdf:li>64</rdf:li>
-       *   </rdf:Seq> </exif:ISOSpeedRatings>
-       * @endcode
-       *
-       * This method is called when we hit the "</rdf:Seq>".
-       * (For comparison, we call endElementModeSimple when we
-       * hit the "</rdf:li>")
-       *
-       * @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 "</property>"
+        *
+        * @par For example, when processing:
+        * @code{,xml}
+        * <exif:ISOSpeedRatings> <rdf:Seq> <rdf:li>64</rdf:li>
+        *   </rdf:Seq> </exif:ISOSpeedRatings>
+        * @endcode
+        *
+        * This method is called when we hit the "</rdf:Seq>".
+        * (For comparison, we call endElementModeSimple when we
+        * hit the "</rdf:li>")
+        *
+        * @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:
-       * <exif:DigitalZoomRatio><rdf:Description><rdf:value>0/10</rdf:value>
-       *   <foo:someQualifier>Bar</foo:someQualifier> </rdf:Description>
-       *   </exif:DigitalZoomRatio>
-       *
-       * This method is called when processing the <rdf:Description> 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:
+        * <exif:DigitalZoomRatio><rdf:Description><rdf:value>0/10</rdf:value>
+        *   <foo:someQualifier>Bar</foo:someQualifier> </rdf:Description>
+        *   </exif:DigitalZoomRatio>
+        *
+        * This method is called when processing the <rdf:Description> 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):
-       *
-       * <exif:Flash> <rdf:Description> <exif:Fired>True</exif:Fired>
-       *  <exif:Mode>1</exif:Mode></rdf:Description></exif:Flash>
-       *
-       * or:
-       *
-       * <exif:Flash rdf:parseType='Resource'> <exif:Fired>True</exif:Fired>
-       *  <exif:Mode>1</exif:Mode></exif:Flash>
-       *
-       * @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):
+        *
+        * <exif:Flash> <rdf:Description> <exif:Fired>True</exif:Fired>
+        *  <exif:Mode>1</exif:Mode></rdf:Description></exif:Flash>
+        *
+        * or:
+        *
+        * <exif:Flash rdf:parseType='Resource'> <exif:Fired>True</exif:Fired>
+        *  <exif:Mode>1</exif:Mode></exif:Flash>
+        *
+        * @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 "<space>" 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 "<space>" 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 "<rdf:Description>" tag just has all the simple
-       * properties as attributes.
-       *
-       * @par Example:
-       * @code
-       * <rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" exif:DigitalZoomRatio="0/10">
-       * @endcode
-       *
-       * @param $attribs Array attribute=>value array.
-       */
+        * Process attributes.
+        * Simple values can be stored as either a tag or attribute
+        *
+        * Often the initial "<rdf:Description>" tag just has all the simple
+        * properties as attributes.
+        *
+        * @par Example:
+        * @code
+        * <rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" exif:DigitalZoomRatio="0/10">
+        * @endcode
+        *
+        * @param $attribs Array attribute=>value array.
+        * @throws MWException
+        */
        private function doAttribs( $attribs ) {
 
                // first check for rdf:parseType attribute, as that can change
index f86cf15..156c39e 100644 (file)
@@ -35,6 +35,7 @@ class EhcacheBagOStuff extends BagOStuff {
 
        /**
         * @param $params array
+        * @throws MWException
         */
        function __construct( $params ) {
                if ( !defined( 'CURLOPT_TIMEOUT_MS' ) ) {
index d5de044..40784f5 100644 (file)
@@ -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 ) {
index 296be66..6505183 100644 (file)
@@ -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 ) {
index 1902443..e1a2dd0 100644 (file)
@@ -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 "<hook>"
         * @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 "<hook>"
         * @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. "<test>some stuff</test>".
         * 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 ) {
index 6a4ef0c..e5beba8 100644 (file)
@@ -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 ) {
index 3bf510f..b6bcf63 100644 (file)
@@ -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 ) {
index 6bcc324..9c750b8 100644 (file)
@@ -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
index 34de0ba..15ea5e4 100644 (file)
@@ -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 "<ext>" 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 "<h>" node
+        * @throws MWException
         * @return array
         */
        function splitHeading() {
index 4f04c86..a4e408e 100644 (file)
@@ -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 "<ext>" 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 "<h>" node
         *
+        * @throws MWException
         * @return array
         */
        function splitHeading() {
@@ -1695,6 +1701,7 @@ class PPNode_Hash_Tree implements PPNode {
        /**
         * Split a "<template>" or "<tplarg>" node
         *
+        * @throws MWException
         * @return array
         */
        function splitTemplate() {
index 8b71a1b..8059e35 100644 (file)
@@ -1884,6 +1884,7 @@ class PPNode_HipHop_Tree implements PPNode {
        /**
         * Split a <template> or <tplarg> node
         *
+        * @throws MWException
         * @return array
         */
        function splitTemplate() {
index 3b48a26..f98266e 100644 (file)
@@ -309,6 +309,7 @@ class ResourceLoader {
         *
         * @param $id Mixed: source ID (string), or array( id1 => props1, id2 => props2, ... )
         * @param $properties Array: source properties
+        * @throws MWException
         */
        public function addSource( $id, $properties = null) {
                // Allow multiple sources to be registered in one call
@@ -832,6 +833,7 @@ class ResourceLoader {
         *     associative array mapping message key to value, or a JSON-encoded message blob containing
         *     the same data, wrapped in an XmlJsCode object.
         *
+        * @throws MWException
         * @return string
         */
        public static function makeLoaderImplementScript( $name, $scripts, $styles, $messages ) {
index d0c56ae..7231c0f 100644 (file)
@@ -143,44 +143,45 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *     to $wgScriptPath
         *
         * Below is a description for the $options array:
+        * @throws MWException
         * @par Construction options:
         * @code
-        *      array(
-        *              // Base path to prepend to all local paths in $options. Defaults to $IP
-        *              'localBasePath' => [base path],
-        *              // Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath
-        *              'remoteBasePath' => [base path],
-        *              // Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath
-        *              'remoteExtPath' => [base path],
-        *              // Scripts to always include
-        *              'scripts' => [file path string or array of file path strings],
-        *              // Scripts to include in specific language contexts
-        *              'languageScripts' => array(
-        *                      [language code] => [file path string or array of file path strings],
-        *              ),
-        *              // Scripts to include in specific skin contexts
-        *              'skinScripts' => array(
-        *                      [skin name] => [file path string or array of file path strings],
-        *              ),
-        *              // Scripts to include in debug contexts
-        *              'debugScripts' => [file path string or array of file path strings],
-        *              // Scripts to include in the startup module
-        *              'loaderScripts' => [file path string or array of file path strings],
-        *              // Modules which must be loaded before this module
-        *              'dependencies' => [modile name string or array of module name strings],
-        *              // Styles to always load
-        *              'styles' => [file path string or array of file path strings],
-        *              // Styles to include in specific skin contexts
-        *              'skinStyles' => array(
-        *                      [skin name] => [file path string or array of file path strings],
-        *              ),
-        *              // Messages to always load
-        *              'messages' => [array of message key strings],
-        *              // Group which this module should be loaded together with
-        *              'group' => [group name string],
-        *              // Position on the page to load this module at
-        *              'position' => ['bottom' (default) or 'top']
-        *      )
+        *     array(
+        *         // Base path to prepend to all local paths in $options. Defaults to $IP
+        *         'localBasePath' => [base path],
+        *         // Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath
+        *         'remoteBasePath' => [base path],
+        *         // Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath
+        *         'remoteExtPath' => [base path],
+        *         // Scripts to always include
+        *         'scripts' => [file path string or array of file path strings],
+        *         // Scripts to include in specific language contexts
+        *         'languageScripts' => array(
+        *             [language code] => [file path string or array of file path strings],
+        *         ),
+        *         // Scripts to include in specific skin contexts
+        *         'skinScripts' => array(
+        *             [skin name] => [file path string or array of file path strings],
+        *         ),
+        *         // Scripts to include in debug contexts
+        *         'debugScripts' => [file path string or array of file path strings],
+        *         // Scripts to include in the startup module
+        *         'loaderScripts' => [file path string or array of file path strings],
+        *         // Modules which must be loaded before this module
+        *         'dependencies' => [modile name string or array of module name strings],
+        *         // Styles to always load
+        *         'styles' => [file path string or array of file path strings],
+        *         // Styles to include in specific skin contexts
+        *         'skinStyles' => array(
+        *             [skin name] => [file path string or array of file path strings],
+        *         ),
+        *         // Messages to always load
+        *         'messages' => [array of message key strings],
+        *         // Group which this module should be loaded together with
+        *         'group' => [group name string],
+        *         // Position on the page to load this module at
+        *         'position' => ['bottom' (default) or 'top']
+        *     )
         * @endcode
         */
        public function __construct( $options = array(), $localBasePath = null,
@@ -550,6 +551,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * Gets the contents of a list of JavaScript files.
         *
         * @param $scripts Array: List of file paths to scripts to read, remap and concetenate
+        * @throws MWException
         * @return String: Concatenated and remapped JavaScript data from $scripts
         */
        protected function readScriptFiles( array $scripts ) {
index 4f58099..8b8a3a3 100644 (file)
@@ -184,6 +184,7 @@ abstract class RevDel_List extends RevisionListBase {
         *     comment:         The log comment
         *     authorsIds:      The array of the user IDs of the offenders
         *     authorsIPs:      The array of the IP/anon user offenders
+        * @throws MWException
         */
        protected function updateLog( $params ) {
                // Get the URL param's corresponding DB field
index b32b0ca..84e3cb7 100644 (file)
@@ -104,6 +104,7 @@ class SpecialJavaScriptTest extends SpecialPage {
         * be thrown.
         * @param $html String: The raw HTML.
         * @param $state String: State, one of 'noframework', 'unknownframework' or 'frameworkfound'
+        * @throws MWException
         * @return string
         */
        private function wrapSummaryHtml( $html, $state ) {
index c09da4e..97f0037 100644 (file)
@@ -121,6 +121,8 @@ class SpecialPasswordReset extends FormSpecialPage {
         * userCanExecute(), and if the data array contains 'Username', etc, then Username
         * resets are allowed.
         * @param $data array
+        * @throws MWException
+        * @throws ThrottledError|PermissionsError
         * @return Bool|Array
         */
        public function onSubmit( array $data ) {
index 089f967..7856e54 100644 (file)
@@ -504,6 +504,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
        /**
         * UI entry point for form submission.
+        * @throws PermissionsError
         * @return bool
         */
        protected function submit() {
index fb2005b..853a805 100644 (file)
@@ -149,6 +149,7 @@ class SpecialUnblock extends SpecialPage {
         *
         * @param $data Array
         * @param $context IContextSource
+        * @throws ErrorPageError
         * @return Array( Array(message key, parameters) ) on failure, True on success
         */
        public static function processUnblock( array $data, IContextSource $context ){
index 43ea345..a15fdd2 100644 (file)
@@ -525,6 +525,7 @@ class SpecialUpload extends SpecialPage {
         * Provides output to the user for a result of UploadBase::verifyUpload
         *
         * @param $details Array: result of UploadBase::verifyUpload
+        * @throws MWException
         */
        protected function processVerificationError( $details ) {
                global $wgFileExtensions;
index 1a00d73..6353b1c 100644 (file)
@@ -74,6 +74,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * n.b. Most sanity checking done in UploadStashLocalFile, so this is straightforward.
         *
         * @param $key String: the key of a particular requested file
+        * @throws HttpError
         * @return bool
         */
        public function showUpload( $key ) {
@@ -113,6 +114,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * application the transform parameters
         *
         * @param string $key
+        * @throws UploadStashBadPathException
         * @return array
         */
        private function parseKey( $key ) {
@@ -164,10 +166,11 @@ class SpecialUploadStash extends UnlistedSpecialPage {
 
        /**
         * Scale a file (probably with a locally installed imagemagick, or similar) and output it to STDOUT.
-        * @param $file: File object
-        * @param $params: scaling parameters ( e.g. array( width => '50' ) );
-        * @param $flags: scaling flags ( see File:: constants )
+        * @param $file File
+        * @param $params array Scaling parameters ( e.g. array( width => '50' ) );
+        * @param $flags int Scaling flags ( see File:: constants )
         * @throws MWException
+        * @throws UploadStashFileNotFoundException
         * @return boolean success
         */
        private function outputLocallyScaledThumb( $file, $params, $flags ) {
@@ -258,6 +261,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * Side effect: writes HTTP response to STDOUT.
         *
         * @param $file File object with a local path (e.g. UnregisteredLocalFile, LocalFile. Oddly these don't share an ancestor!)
+        * @throws SpecialUploadStashTooLargeException
         * @return bool
         */
        private function outputLocalFile( File $file ) {
@@ -275,6 +279,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * Side effect: writes HTTP response to STDOUT.
         * @param $content String content
         * @param $contentType String mime type
+        * @throws SpecialUploadStashTooLargeException
         * @return bool
         */
        private function outputContents( $content, $contentType ) {
index b7d01c8..995d879 100644 (file)
@@ -286,6 +286,7 @@ class LoginForm extends SpecialPage {
 
        /**
         * @private
+        * @throws PermissionsError|ReadOnlyError
         * @return bool|User
         */
        function addNewAccountInternal() {
index 9f5a48a..56ae302 100644 (file)
@@ -62,6 +62,7 @@ class UserrightsPage extends SpecialPage {
         * Depending on the submit button used, call a form or a save function.
         *
         * @param $par Mixed: string if any subpage provided, else null
+        * @throws UserBlockedError|PermissionsError
         */
        public function execute( $par ) {
                // If the visitor doesn't have permissions to assign or remove
index bbd9c44..560acde 100644 (file)
@@ -319,8 +319,8 @@ class UploadStash {
        /**
         * Remove a particular file from the stash.  Also removes it from the repo.
         *
-        * @throws UploadStashNotLoggedInException
-        * @throws UploadStashWrongOwnerException
+        * @param $key
+        * @throws UploadStashNoSuchKeyException|UploadStashNotLoggedInException|UploadStashWrongOwnerException
         * @return boolean: success
         */
        public function removeFile( $key ) {
@@ -416,6 +416,8 @@ class UploadStash {
         * with an extension.
         * XXX this is somewhat redundant with the checks that ApiUpload.php does with incoming
         * uploads versus the desired filename. Maybe we can get that passed to us...
+        * @param $path
+        * @throws UploadStashFileException
         * @return string
         */
        public static function getExtensionForPath( $path ) {
index 1056ece..be2b8c3 100644 (file)
@@ -81,6 +81,7 @@ class CLDRPluralRuleEvaluator {
         * @param $token string The token string
         * @param $left The left operand. If it is an object, its state may be destroyed.
         * @param $right The right operand
+        * @throws CLDRPluralRuleError
         * @return mixed
         */
        private static function doOperation( $token, $left, $right ) {
index 2a0932a..1860f4a 100644 (file)
@@ -305,6 +305,7 @@ ENDS;
        /**
         * Check a language.
         * @param $code string The language code.
+        * @throws MWException
         * @return array The results.
         */
        protected function checkLanguage( $code ) {
@@ -641,6 +642,7 @@ ENDS;
        /**
         * Check a language and show the results.
         * @param $code string The language code.
+        * @throws MWException
         */
        protected function checkLanguage( $code ) {
                foreach( $this->extensions as $extension ) {
index f45525c..c591665 100644 (file)
@@ -68,6 +68,8 @@ class LockServerDaemon {
 
        /**
         * @params $config Array
+        * @param array $config
+        * @throws Exception
         * @return LockServerDaemon
         */
        public static function init( array $config ) {
@@ -113,6 +115,7 @@ class LockServerDaemon {
        }
 
        /**
+        * @throws Exception
         * @return void
         */
        protected function setupServerSocket() {
index a8a1fce..16568ac 100644 (file)
@@ -43,6 +43,8 @@ class Sqlite {
         * Checks given files for correctness of SQL syntax. MySQL DDL will be converted to
         * SQLite-compatible during processing.
         * Will throw exceptions on SQL errors
+        * @param $files
+        * @throws MWException
         * @return mixed true if no error or error string in case of errors
         */
        public static function checkSqlSyntax( $files ) {