More return documentation
authorSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:35:05 +0000 (21:35 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:35:05 +0000 (21:35 +0000)
42 files changed:
includes/Init.php
includes/Linker.php
includes/LocalisationCache.php
includes/MimeMagic.php
includes/Namespace.php
includes/OutputPage.php
includes/PoolCounter.php
includes/installer/DatabaseInstaller.php
includes/installer/Installer.php
includes/installer/OracleInstaller.php
includes/installer/PostgresInstaller.php
includes/installer/PostgresUpdater.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerPage.php
includes/json/Services_JSON.php
includes/logging/LogEntry.php
includes/logging/LogFormatter.php
includes/logging/LogPager.php
includes/media/Bitmap.php
includes/media/DjVu.php
includes/media/DjVuImage.php
includes/media/Exif.php
includes/media/Generic.php
includes/media/MediaTransformOutput.php
includes/media/SVGMetadataExtractor.php
includes/normal/UtfNormal.php
includes/normal/UtfNormalTest.php
includes/normal/UtfNormalTest2.php
includes/objectcache/BagOStuff.php
includes/objectcache/MemcachedClient.php
includes/objectcache/MemcachedPhpBagOStuff.php
includes/objectcache/MultiWriteBagOStuff.php
includes/objectcache/SqlBagOStuff.php
includes/parser/CoreParserFunctions.php
includes/parser/DateFormatter.php
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/parser/ParserCache.php
includes/parser/ParserOptions.php
includes/parser/ParserOutput.php
includes/parser/Preprocessor_DOM.php
includes/profiler/Profiler.php

index 72c1054..5bfd3f5 100644 (file)
@@ -197,6 +197,7 @@ class MWInit {
         * @param $methodName string
         * @param $args array
         *
+        * @return mixed
         */
        static function callStaticMethod( $className, $methodName, $args ) {
                $r = new ReflectionMethod( $className, $methodName );
index 6c00903..4d49411 100644 (file)
@@ -20,6 +20,7 @@ class Linker {
         *
         * @param $class String: the contents of the class attribute; if an empty
         *   string is passed, which is the default value, defaults to 'external'.
+        * @return string
         * @deprecated since 1.18 Just pass the external class directly to something using Html::expandAttributes
         */
        static function getExternalLinkAttributes( $class = 'external' ) {
@@ -36,6 +37,7 @@ class Linker {
         * @param $unused String: unused
         * @param $class String: the contents of the class attribute; if an empty
         *   string is passed, which is the default value, defaults to 'external'.
+        * @return string
         */
        static function getInterwikiLinkAttributes( $title, $unused = null, $class = 'external' ) {
                global $wgContLang;
@@ -57,6 +59,7 @@ class Linker {
         *   not HTML-escaped
         * @param $unused String: unused
         * @param $class String: the contents of the class attribute, default none
+        * @return string
         */
        static function getInternalLinkAttributes( $title, $unused = null, $class = '' ) {
                $title = urldecode( $title );
@@ -73,6 +76,7 @@ class Linker {
         * @param $class String: the contents of the class attribute, default none
         * @param $title Mixed: optional (unescaped) string to use in the title
         *   attribute; if false, default to the name of the page we're linking to
+        * @return string
         */
        static function getInternalLinkAttributesObj( $nt, $unused = null, $class = '', $title = false ) {
                if ( $title === false ) {
@@ -229,6 +233,7 @@ class Linker {
 
        /**
         * Identical to link(), except $options defaults to 'known'.
+        * @return string
         */
        public static function linkKnown(
                $target, $html = null, $customAttribs = array(),
@@ -243,6 +248,7 @@ class Linker {
         * @param $target Title
         * @param $query Array: query parameters
         * @param $options Array
+        * @return String
         */
        private static function linkUrl( $target, $query, $options ) {
                wfProfileIn( __METHOD__ );
@@ -641,6 +647,7 @@ class Linker {
         * @param $params Array
         * @param $framed Boolean
         * @param $manualthumb String
+        * @return mixed
         */
        public static function makeThumbLinkObj( Title $title, $file, $label = '', $alt,
                $align = 'right', $params = array(), $framed = false , $manualthumb = "" )
@@ -893,6 +900,7 @@ class Linker {
         * @param $escape Boolean: do we escape the link text?
         * @param $linktype String: type of external link. Gets added to the classes
         * @param $attribs Array of extra attributes to <a>
+        * @return string
         */
        public static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
                $class = "external";
@@ -998,6 +1006,7 @@ class Linker {
         * @param $userId Integer: user identifier
         * @param $userText String: user name or IP address
         * @param $edits Integer: user edit count (optional, for performance)
+        * @return String
         */
        public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
                return self::userToolLinks( $userId, $userText, true, 0, $edits );
@@ -1096,6 +1105,7 @@ class Linker {
         * @param $comment String
         * @param $title Mixed: Title object (to generate link to the section in autocomment) or null
         * @param $local Boolean: whether section links should refer to local page
+        * @return mixed|String
         */
        public static function formatComment( $comment, $title = null, $local = false ) {
                wfProfileIn( __METHOD__ );
@@ -1474,6 +1484,7 @@ class Linker {
         * End a Table Of Contents line.
         * tocUnindent() will be used instead if we're ending a line below
         * the new level.
+        * @return string
         */
        public static function tocLineEnd() {
                return "</li>\n";
@@ -1552,6 +1563,7 @@ class Linker {
        /**
         * Split a link trail, return the "inside" portion and the remainder of the trail
         * as a two-element array
+        * @return array
         */
        static function splitTrail( $trail ) {
                global $wgContLang;
@@ -1579,6 +1591,7 @@ class Linker {
         * other users.
         *
         * @param $rev Revision object
+        * @return string
         */
        public static function generateRollback( $rev ) {
                return '<span class="mw-rollback-link">['
@@ -1886,6 +1899,7 @@ class Linker {
         * @param $trail String: Optional trail. Alphabetic characters at the start of this string will
         *               be included in the link text. Other characters will be appended after
         *               the end of the link.
+        * @return string
         */
        static function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
                wfDeprecated( __METHOD__, '1.16' );
@@ -1914,6 +1928,7 @@ class Linker {
         *                      be included in the link text. Other characters will be appended after
         *                      the end of the link.
         * @param $prefix String: optional prefix. As trail, only before instead of after.
+        * @return string
         */
        static function makeLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
                # wfDeprecated( __METHOD__, '1.16' ); // See r105985 and it's revert. Somewhere still used.
@@ -1983,6 +1998,7 @@ class Linker {
         *                      be included in the link text. Other characters will be appended after
         *                      the end of the link.
         * @param $prefix String: Optional prefix
+        * @return string
         */
        static function makeBrokenLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '' ) {
                wfDeprecated( __METHOD__, '1.16' );
@@ -2014,6 +2030,7 @@ class Linker {
         *                      be included in the link text. Other characters will be appended after
         *                      the end of the link.
         * @param $prefix String: Optional prefix
+        * @return string
         */
        static function makeColouredLinkObj( $nt, $colour, $text = '', $query = '', $trail = '', $prefix = '' ) {
                wfDeprecated( __METHOD__, '1.16' );
@@ -2028,6 +2045,7 @@ class Linker {
 
        /**
         * Returns the attributes for the tooltip and access key.
+        * @return array
         */
        public static function tooltipAndAccesskeyAttribs( $name ) {
                # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
@@ -2048,6 +2066,7 @@ class Linker {
 
        /**
         * Returns raw bits of HTML, use titleAttrib()
+        * @return null|string
         */
        public static function tooltip( $name, $options = null ) {
                # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
@@ -2074,6 +2093,7 @@ class DummyLinker {
         *
         * @param $fname String Name of called method
         * @param $args Array Arguments to the method
+        * @return mixed
         */
        public function __call( $fname, $args ) {
                return call_user_func_array( array( 'Linker', $fname ), $args );
index 7e3a09c..f62adc7 100644 (file)
@@ -343,6 +343,7 @@ class LocalisationCache {
 
        /**
         * Returns true if the cache identified by $code is missing or expired.
+        * @return bool
         */
        public function isExpired( $code ) {
                if ( $this->forceRecache && !isset( $this->recachedLangs[$code] ) ) {
index f86b605..b91af61 100644 (file)
@@ -566,6 +566,7 @@ class MimeMagic {
         *
         * @param string $file
         * @param mixed $ext
+        * @return bool|string
         */
        private function doGuessMimeType( $file, $ext ) { // TODO: remove $ext param
                // Read a chunk of the file
@@ -1030,6 +1031,7 @@ class MimeMagic {
         *
         * This funktion relies on the mapping defined by $this->mMediaTypes
         * @access private
+        * @return int|string
         */
        function findMediaType( $extMime ) {
                if ( strpos( $extMime, '.' ) === 0 ) { 
@@ -1067,6 +1069,7 @@ class MimeMagic {
         * @param $fileName String: the file name (unused at present)
         * @param $chunk String: the first 256 bytes of the file
         * @param $proposed String: the MIME type proposed by the server
+        * @return Array
         */
        public function getIEMimeTypes( $fileName, $chunk, $proposed ) {
                $ca = $this->getIEContentAnalyzer();
index e536d8b..6ff6f0b 100644 (file)
@@ -67,6 +67,7 @@ class MWNamespace {
        /**
         * @see self::isSubject
         * @deprecated Please use the more consistently named isSubject (since 1.19)
+        * @return bool
         */
        public static function isMain( $index ) {
                wfDeprecated( __METHOD__, '1.19' );
index 2cc6f4c..ae55d3f 100644 (file)
@@ -2788,6 +2788,7 @@ $templates
 
        /**
         * JS stuff to put at the bottom of the <body>
+        * @return string
         */
        function getBottomScripts() {
                global $wgResourceLoaderExperimentalAsyncLoading;
index 83ae0ab..4edcb06 100644 (file)
@@ -150,6 +150,7 @@ abstract class PoolCounterWork {
 
        /**
         * Do something with the error, like showing it to the user.
+        * @return bool
         */
        function error( $status ) {
                return false;
index 33327ef..8cbc8c6 100644 (file)
@@ -88,6 +88,7 @@ abstract class DatabaseInstaller {
         * $this->parent can be assumed to be a WebInstaller.
         * If the DB type has no settings beyond those already configured with
         * getConnectForm(), this should return false.
+        * @return bool
         */
        public function getSettingsForm() {
                return false;
@@ -207,6 +208,7 @@ abstract class DatabaseInstaller {
        /**
         * Override this to provide DBMS-specific schema variables, to be
         * substituted into tables.sql and other schema files.
+        * @return array
         */
        public function getSchemaVars() {
                return array();
@@ -282,6 +284,7 @@ abstract class DatabaseInstaller {
 
        /**
         * Get an array of MW configuration globals that will be configured by this class.
+        * @return array
         */
        public function getGlobalNames() {
                return $this->globalNames;
@@ -313,6 +316,7 @@ abstract class DatabaseInstaller {
 
        /**
         * Get the internationalised name for this DBMS.
+        * @return String
         */
        public function getReadableName() {
                return wfMsg( 'config-type-' . $this->getName() );
@@ -321,6 +325,7 @@ abstract class DatabaseInstaller {
        /**
         * Get a name=>value map of MW configuration globals that overrides.
         * DefaultSettings.php
+        * @return array
         */
        public function getGlobalDefaults() {
                return array();
@@ -328,6 +333,7 @@ abstract class DatabaseInstaller {
 
        /**
         * Get a name=>value map of internal variables used during installation.
+        * @return array
         */
        public function getInternalDefaults() {
                return $this->internalDefaults;
@@ -439,6 +445,7 @@ abstract class DatabaseInstaller {
         *      values:         List of allowed values (required)
         *      itemAttribs     Array of attribute arrays, outer key is the value name (optional)
         *
+        * @return string
         */
        public function getRadioSet( $params ) {
                $params['controlName'] = $this->getName() . '_' . $params['var'];
@@ -451,6 +458,7 @@ abstract class DatabaseInstaller {
         * Assumes that variables containing "password" in the name are (potentially
         * fake) passwords.
         * @param $varNames Array
+        * @return array
         */
        public function setVarsFromRequest( $varNames ) {
                return $this->parent->setVarsFromRequest( $varNames, $this->getName() . '_' );
@@ -494,6 +502,7 @@ abstract class DatabaseInstaller {
 
        /**
         * Submit a standard install user fieldset.
+        * @return Status
         */
        public function submitInstallUserBox() {
                $this->setVarsFromRequest( array( '_InstallUser', '_InstallPassword' ) );
index 5580f17..0b6dc13 100644 (file)
@@ -672,6 +672,7 @@ abstract class Installer {
 
        /**
         * Some versions of libxml+PHP break < and > encoding horribly
+        * @return bool
         */
        protected function envCheckBrokenXML() {
                $test = new PhpXmlBugTester();
@@ -684,6 +685,7 @@ abstract class Installer {
        /**
         * Test PHP (probably 5.3.1, but it could regress again) to make sure that
         * reference parameters to __call() are not converted to null
+        * @return bool
         */
        protected function envCheckPHP531() {
                $test = new PhpRefCallBugTester;
@@ -696,6 +698,7 @@ abstract class Installer {
 
        /**
         * Environment check for magic_quotes_runtime.
+        * @return bool
         */
        protected function envCheckMagicQuotes() {
                if( wfIniGetBool( "magic_quotes_runtime" ) ) {
@@ -706,6 +709,7 @@ abstract class Installer {
 
        /**
         * Environment check for magic_quotes_sybase.
+        * @return bool
         */
        protected function envCheckMagicSybase() {
                if ( wfIniGetBool( 'magic_quotes_sybase' ) ) {
@@ -716,6 +720,7 @@ abstract class Installer {
 
        /**
         * Environment check for mbstring.func_overload.
+        * @return bool
         */
        protected function envCheckMbstring() {
                if ( wfIniGetBool( 'mbstring.func_overload' ) ) {
@@ -726,6 +731,7 @@ abstract class Installer {
 
        /**
         * Environment check for zend.ze1_compatibility_mode.
+        * @return bool
         */
        protected function envCheckZE1() {
                if ( wfIniGetBool( 'zend.ze1_compatibility_mode' ) ) {
@@ -746,6 +752,7 @@ abstract class Installer {
 
        /**
         * Environment check for the XML module.
+        * @return bool
         */
        protected function envCheckXML() {
                if ( !function_exists( "utf8_encode" ) ) {
@@ -756,6 +763,7 @@ abstract class Installer {
 
        /**
         * Environment check for the PCRE module.
+        * @return bool
         */
        protected function envCheckPCRE() {
                if ( !function_exists( 'preg_match' ) ) {
@@ -773,6 +781,7 @@ abstract class Installer {
 
        /**
         * Environment check for available memory.
+        * @return bool
         */
        protected function envCheckMemory() {
                $limit = ini_get( 'memory_limit' );
@@ -846,6 +855,7 @@ abstract class Installer {
 
        /**
         * Environment check for ImageMagick and GD.
+        * @return bool
         */
        protected function envCheckGraphics() {
                $names = array( wfIsWindows() ? 'convert.exe' : 'convert' );
@@ -981,6 +991,7 @@ abstract class Installer {
 
        /**
         * TODO: document
+        * @return bool
         */
        protected function envCheckUploadsDirectory() {
                global $IP;
@@ -1121,6 +1132,7 @@ abstract class Installer {
         *
         * If $versionInfo is not false, only executables with a version
         * matching $versionInfo[1] will be returned.
+        * @return bool|string
         */
        public static function locateExecutable( $path, $names, $versionInfo = false ) {
                if ( !is_array( $names ) ) {
@@ -1169,6 +1181,7 @@ abstract class Installer {
         * Checks if scripts located in the given directory can be executed via the given URL.
         *
         * Used only by environment checks.
+        * @return bool|int|string
         */
        public function dirIsExecutable( $dir, $url ) {
                $scriptTypes = array(
index 7f04f75..b457033 100644 (file)
@@ -241,6 +241,7 @@ class OracleInstaller extends DatabaseInstaller {
 
        /**
         * Overload: after this action field info table has to be rebuilt
+        * @return Status
         */
        public function createTables() {
                $this->setupSchemaVars();
index eb9ba28..fa5a628 100644 (file)
@@ -344,6 +344,7 @@ class PostgresInstaller extends DatabaseInstaller {
        /**
         * Returns true if the install user is able to create objects owned
         * by the web user, false otherwise.
+        * @return bool
         */
        protected function canCreateObjectsForWebUser() {
                if ( $this->isSuperUser() ) {
index 41e5b31..9f4b760 100644 (file)
@@ -23,6 +23,7 @@ class PostgresUpdater extends DatabaseUpdater {
        /**
         * @todo FIXME: Postgres should use sequential updates like Mysql, Sqlite
         * and everybody else. It never got refactored like it should've.
+        * @return array
         */
        protected function getCoreUpdateList() {
                return array(
index 1ff77db..c340d9a 100644 (file)
@@ -433,6 +433,7 @@ class WebInstaller extends Installer {
         *
         * @param $name String
         * @param $default
+        * @return null
         */
        public function getSession( $name, $default = null ) {
                if ( !isset( $this->session[$name] ) ) {
index 85ec880..9f5b0e4 100644 (file)
@@ -36,6 +36,7 @@ abstract class WebInstallerPage {
         * Is this a slow-running page in the installer? If so, WebInstaller will
         * set_time_limit(0) before calling execute(). Right now this only applies
         * to Install and Upgrade pages
+        * @return bool
         */
        public function isSlow() {
                return false;
index b2090dc..398ed6a 100644 (file)
@@ -826,6 +826,7 @@ class Services_JSON
 
        /**
         * @todo Ultimately, this should just call PEAR::isError()
+        * @return bool
         */
        function isError($data, $code = null)
        {
index b28a24d..66f0611 100644 (file)
@@ -97,6 +97,7 @@ abstract class LogEntryBase implements LogEntry {
        /**
         * Whether the parameters for this log are stored in new or
         * old format.
+        * @return bool
         */
        public function isLegacy() {
                return false;
index 945660c..6c454b3 100644 (file)
@@ -272,6 +272,7 @@ class LogFormatter {
         * Provides the name of the user who performed the log action.
         * Used as part of log action message or standalone, depending
         * which parts of the log entry has been hidden.
+        * @return String
         */
        public function getPerformerElement() {
                if ( $this->canView( LogPage::DELETED_USER ) ) {
index 16781a6..ea1be8e 100644 (file)
@@ -131,6 +131,7 @@ class LogPager extends ReverseChronologicalPager {
         * Set the log reader to return only entries by the given user.
         *
         * @param $name String: (In)valid user name
+        * @return bool
         */
        private function limitPerformer( $name ) {
                if( $name == '' ) {
@@ -166,6 +167,7 @@ class LogPager extends ReverseChronologicalPager {
         *
         * @param $page String or Title object: Title name
         * @param $pattern String
+        * @return bool
         */
        private function limitTitle( $page, $pattern ) {
                global $wgMiserMode;
index 619485c..3e039ff 100644 (file)
@@ -572,6 +572,7 @@ class BitmapHandler extends ImageHandler {
        /**
         * Escape a string for ImageMagick's property input (e.g. -set -comment)
         * See InterpretImageProperties() in magick/property.c
+        * @return mixed|string
         */
        function escapeMagickProperty( $s ) {
                // Double the backslashes
@@ -599,6 +600,7 @@ class BitmapHandler extends ImageHandler {
         *
         * @param $path string The file path
         * @param $scene string The scene specification, or false if there is none
+        * @return string
         */
        function escapeMagickInput( $path, $scene = false ) {
                # Die on initial metacharacters (caller should prepend path)
@@ -616,6 +618,7 @@ class BitmapHandler extends ImageHandler {
        /**
         * Escape a string for ImageMagick's output filename. See
         * InterpretImageFilename() in magick/image.c.
+        * @return string
         */
        function escapeMagickOutput( $path, $scene = false ) {
                $path = str_replace( '%', '%%', $path );
@@ -628,6 +631,7 @@ class BitmapHandler extends ImageHandler {
         *
         * @param $path string The file path
         * @param $scene string The scene specification, or false if there is none
+        * @return string
         */
        protected function escapeMagickPath( $path, $scene = false ) {
                # Die on format specifiers (other than drive letters). The regex is
index dedbee0..2f960d9 100644 (file)
@@ -191,6 +191,7 @@ class DjVuHandler extends ImageHandler {
         * Cache a document tree for the DjVu XML metadata
         * @param $image File
         * @param $gettext Boolean: DOCUMENT (Default: false)
+        * @return bool
         */
        function getMetaTree( $image , $gettext = false ) {
                if ( isset( $image->dejaMetaTree ) ) {
index 80b7408..25aacdc 100644 (file)
@@ -284,6 +284,7 @@ EOR;
 
        /**
         * Hack to temporarily work around djvutoxml bug
+        * @return bool|string
         */
        function convertDumpToXML( $dump ) {
                if ( strval( $dump ) == '' ) {
index a4acdfe..4fb13c6 100644 (file)
@@ -549,6 +549,7 @@ class Exif {
         */
        /**
         * Get $this->mRawExifData
+        * @return array
         */
        function getData() {
                return $this->mRawExifData;
index b118309..af1ca4d 100644 (file)
@@ -160,6 +160,7 @@ abstract class MediaHandler {
         * MediaHandler::METADATA_GOOD for if the metadata is a-ok,
         * MediaHanlder::METADATA_COMPATIBLE if metadata is old but backwards
         * compatible (which may or may not trigger a metadata reload).
+        * @return bool
         */
        function isMetadataValid( $image, $metadata ) {
                return self::METADATA_GOOD;
@@ -173,6 +174,7 @@ abstract class MediaHandler {
         * Used when the repository has a thumbnailScriptUrl option configured.
         *
         * Return false to fall back to the regular getTransform().
+        * @return bool
         */
        function getScriptedTransform( $image, $script, $params ) {
                return false;
@@ -186,6 +188,7 @@ abstract class MediaHandler {
         * @param $dstPath String: filesystem destination path
         * @param $dstUrl String: Destination URL to use in output HTML
         * @param $params Array: Arbitrary set of parameters validated by $this->validateParam()
+        * @return \MediaTransformOutput
         */
        final function getTransform( $image, $dstPath, $dstUrl, $params ) {
                return $this->doTransform( $image, $dstPath, $dstUrl, $params, self::TRANSFORM_LATER );
@@ -227,27 +230,33 @@ abstract class MediaHandler {
 
        /**
         * True if the handled types can be transformed
+        * @return bool
         */
        function canRender( $file ) { return true; }
        /**
         * True if handled types cannot be displayed directly in a browser
         * but can be rendered
+        * @return bool
         */
        function mustRender( $file ) { return false; }
        /**
         * True if the type has multi-page capabilities
+        * @return bool
         */
        function isMultiPage( $file ) { return false; }
        /**
         * Page count for a multi-page document, false if unsupported or unknown
+        * @return bool
         */
        function pageCount( $file ) { return false; }
        /**
         * The material is vectorized and thus scaling is lossless
+        * @return bool
         */
        function isVectorized( $file ) { return false; }
        /**
         * False if the handler is disabled for all files
+        * @return bool
         */
        function isEnabled() { return true; }
 
@@ -258,6 +267,7 @@ abstract class MediaHandler {
         * Returns false if unknown or if the document is not multi-page.
         *
         * @param $image File
+        * @return array
         */
        function getPageDimensions( $image, $page ) {
                $gis = $this->getImageSize( $image, $image->getLocalRefPath() );
@@ -270,6 +280,7 @@ abstract class MediaHandler {
        /**
         * Generic getter for text layer.
         * Currently overloaded by PDF and DjVu handlers
+        * @return bool
         */
        function getPageText( $image, $page ) {
                return false;
@@ -300,6 +311,7 @@ abstract class MediaHandler {
         * all the formatting according to some standard. That makes it possible
         * to do things like visual indication of grouped and chained streams
         * in ogg container files.
+        * @return bool
         */
        function formatMetadata( $image ) {
                return false;
index ed2ba8c..380731c 100644 (file)
@@ -80,6 +80,7 @@ abstract class MediaTransformOutput {
 
        /**
         * This will be overridden to return true in error classes
+        * @return bool
         */
        public function isError() {
                return false;
index db9f05f..26e42d1 100644 (file)
@@ -99,6 +99,7 @@ class SVGReader {
 
        /**
         * Read the SVG
+        * @return bool
         */
        public function read() {
                $keepReading = $this->reader->read();
index b5aad30..2b400e5 100644 (file)
@@ -238,6 +238,7 @@ class UtfNormal {
         * Returns true if the string is _definitely_ in NFC.
         * Returns false if not or uncertain.
         * @param $string String: a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
+        * @return bool
         */
        static function quickIsNFCVerify( &$string ) {
                # Screen out some characters that eg won't be allowed in XML
index e5ae7f7..5872ec3 100644 (file)
@@ -37,6 +37,7 @@ if( defined( 'PRETTY_UTF8' ) ) {
 } else {
        /**
         * @ignore
+        * @return string
         */
        function pretty( $string ) {
                return trim( preg_replace( '/(.)/use',
index 28be483..f478fa9 100644 (file)
@@ -61,6 +61,7 @@ function normalize_form_kd($c)     { return UtfNormal::toNFKD($c); }
  * following functions to force pure PHP usage.  I decided not to
  * commit that code since might produce a slowdown in the UTF
  * normalization code just for the sake of these tests. -- hexmode
+ * @return string
  */
 function normalize_form_c_php($c)  { return UtfNormal::toNFC($c, "php");  }
 function normalize_form_d_php($c)  { return UtfNormal::toNFD($c, "php");  }
index 52387f7..a4545ef 100644 (file)
@@ -155,6 +155,7 @@ abstract class BagOStuff {
 
        /**
         * Convert an optionally relative time to an absolute time
+        * @return int
         */
        protected function convertExpiry( $exptime ) {
                if ( ( $exptime != 0 ) && ( $exptime < 86400 * 3650 /* 10 years */ ) ) {
index 868ad69..f8208f6 100644 (file)
@@ -871,6 +871,7 @@ class MWMemcached {
         * @param $sock Resource: socket to read from
         * @param $ret Array: returned values
         *
+        * @return bool|int
         * @access private
         */
        function _load_items( $sock, &$ret ) {
@@ -1079,6 +1080,7 @@ class MWMemcached {
 
        /**
         * Original behaviour
+        * @return int
         */
        function _safe_fwrite( $f, $buf, $len = false ) {
                if ( $len === false ) {
index 1401668..021dfb7 100644 (file)
@@ -153,6 +153,7 @@ class MemcachedPhpBagOStuff extends BagOStuff {
         * the other control characters for compatibility with libmemcached 
         * verify_key. We leave other punctuation alone, to maximise backwards
         * compatibility.
+        * @return string
         */
        public function encodeKey( $key ) {
                return preg_replace_callback( '/[\x00-\x20\x25\x7f]+/', 
index 0d95a84..9063093 100644 (file)
@@ -100,6 +100,7 @@ class MultiWriteBagOStuff extends BagOStuff {
         * Delete objects expiring before a certain date. 
         *
         * Succeed if any of the child caches succeed.
+        * @return bool
         */
        public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
                $ret = false;
index 93d22f1..617c093 100644 (file)
@@ -92,6 +92,7 @@ class SqlBagOStuff extends BagOStuff {
 
        /**
         * Get the table name for a given key
+        * @return string
         */
        protected function getTableByKey( $key ) {
                if ( $this->shards > 1 ) {
@@ -104,6 +105,7 @@ class SqlBagOStuff extends BagOStuff {
 
        /**
         * Get the table name for a given shard index
+        * @return string
         */
        protected function getTableByShard( $index ) {
                if ( $this->shards > 1 ) {
@@ -310,6 +312,7 @@ class SqlBagOStuff extends BagOStuff {
 
        /**
         * Delete objects from the database which expire before a certain date.
+        * @return bool
         */
        public function deleteObjectsExpiringBefore( $timestamp, $progressCallback = false ) {
                $db = $this->getDB();
index f9ae237..13aa66f 100644 (file)
@@ -154,6 +154,7 @@ class CoreParserFunctions {
         * @param $parser Parser object
         * @param $s String: The text to encode.
         * @param $arg String (optional): The type of encoding.
+        * @return string
         */
        static function urlencode( $parser, $s = '', $arg = null ) {
                static $magicWords = null;
@@ -418,6 +419,7 @@ class CoreParserFunctions {
         * corresponding magic word
         * Note: function name changed to "mwnamespace" rather than "namespace"
         * to not break PHP 5.3
+        * @return mixed|string
         */
        static function mwnamespace( $parser, $title = null ) {
                $t = Title::newFromText( $title );
@@ -459,6 +461,7 @@ class CoreParserFunctions {
        /**
         * Functions to get and normalize pagenames, corresponding to the magic words
         * of the same names
+        * @return String
         */
        static function pagename( $parser, $title = null ) {
                $t = Title::newFromText( $title );
@@ -537,6 +540,7 @@ class CoreParserFunctions {
         * Return the number of pages in the given category, or 0 if it's nonexis-
         * tent.  This is an expensive parser function and can't be called too many
         * times per page.
+        * @return string
         */
        static function pagesincategory( $parser, $name = '', $raw = null ) {
                static $cache = array();
@@ -574,6 +578,7 @@ class CoreParserFunctions {
         * @param $parser Parser
         * @param $page String TODO DOCUMENT (Default: empty string)
         * @param $raw TODO DOCUMENT (Default: null)
+        * @return string
         */
        static function pagesize( $parser, $page = '', $raw = null ) {
                static $cache = array();
@@ -603,7 +608,8 @@ class CoreParserFunctions {
 
        /**
        * Returns the requested protection level for the current page
-       */
+        * @return string
+        */
        static function protectionlevel( $parser, $type = '' ) {
                $restrictions = $parser->mTitle->getRestrictions( strtolower( $type ) );
                # Title::getRestrictions returns an array, its possible it may have
@@ -634,6 +640,7 @@ class CoreParserFunctions {
 
        /**
         * Unicode-safe str_pad with the restriction that $length is forced to be <= 500
+        * @return string
         */
        static function pad( $string, $length, $padding = '0', $direction = STR_PAD_RIGHT ) {
                $lengthOfPadding = mb_strlen( $padding );
@@ -764,6 +771,7 @@ class CoreParserFunctions {
 
        /**
         * Parser function to extension tag adaptor
+        * @return string
         */
        public static function tagObj( $parser, $frame, $args ) {
                if ( !count( $args ) ) {
index 6559e88..2199004 100644 (file)
@@ -122,6 +122,7 @@ class DateFormatter
         * @param $preference String: User preference
         * @param $text String: Text to reformat
         * @param $options Array: can contain 'linked' and/or 'match-whole'
+        * @return mixed|String
         */
        function reformat( $preference, $text, $options = array('linked') ) {
        
@@ -172,6 +173,7 @@ class DateFormatter
 
        /**
         * @param $matches
+        * @return string
         */
        function replace( $matches ) {
                # Extract information from $matches
@@ -282,6 +284,7 @@ class DateFormatter
 
        /**
         * @todo document
+        * @return string
         */
        function getMonthRegex() {
                global $wgContLang;
@@ -325,6 +328,7 @@ class DateFormatter
 
        /**
         * @todo document
+        * @return int|string
         */
        function makeNormalYear( $iso ) {
                if ( $iso[0] == '-' ) {
index fb01304..69fd206 100644 (file)
@@ -33,7 +33,8 @@ class LinkHolderArray {
         * serializing at present.
         *
         * Compact the titles, only serialize the text form.
-        */
+         * @return array
+         */
        function __sleep() {
                foreach ( $this->internals as &$nsLinks ) {
                        foreach ( $nsLinks as &$entry ) {
@@ -134,6 +135,7 @@ class LinkHolderArray {
        /**
         * Get a subset of the current LinkHolderArray which is sufficient to
         * interpret the given text.
+        * @return \LinkHolderArray
         */
        function getSubArray( $text ) {
                $sub = new LinkHolderArray( $this->parent );
@@ -167,6 +169,7 @@ class LinkHolderArray {
 
        /**
         * Returns true if the memory requirements of this object are getting large
+        * @return bool
         */
        function isBig() {
                global $wgLinkHolderBatchSize;
@@ -190,6 +193,7 @@ class LinkHolderArray {
         * article length checks (for stub links) to be bundled into a single query.
         *
         * @param $nt Title
+        * @return string
         */
        function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = ''  ) {
                wfProfileIn( __METHOD__ );
index 0b18c5a..d308456 100644 (file)
@@ -494,6 +494,7 @@ class Parser {
        /**
         * Expand templates and variables in the text, producing valid, static wikitext.
         * Also removes comments.
+        * @return mixed|string
         */
        function preprocess( $text, Title $title, ParserOptions $options, $revid = null ) {
                wfProfileIn( __METHOD__ );
@@ -840,6 +841,7 @@ class Parser {
         * parse the wiki syntax used to render tables
         *
         * @private
+        * @return string
         */
        function doTableStuff( $text ) {
                wfProfileIn( __METHOD__ );
@@ -3892,6 +3894,7 @@ class Parser {
         * @param $text String
         * @param $origText String: original, untouched wikitext
         * @param $isMain Boolean
+        * @return mixed|string
         * @private
         */
        function formatHeadings( $text, $origText, $isMain=true ) {
@@ -4711,6 +4714,7 @@ 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.
+        * @return null
         */
        function setFunctionTagHook( $tag, $callback, $flags ) {
                $tag = strtolower( $tag );
index 64a1aa0..bde310e 100644 (file)
@@ -77,6 +77,7 @@ class ParserCache {
         *
         * @param $article Article
         * @param $popts ParserOptions
+        * @return string
         */
        function getETag( $article, $popts ) {
                return 'W/"' . $this->getParserOutputKey( $article,
@@ -104,6 +105,7 @@ class ParserCache {
         *
         * @param $article Article
         * @param $popts ParserOptions
+        * @return bool|mixed|string
         */
        public function getKey( $article, $popts, $useOutdated = true ) {
                global $wgCacheEpoch;
index 57d3a7e..bf9611f 100644 (file)
@@ -428,6 +428,7 @@ class ParserOptions {
         * Returns the full array of options that would have been used by
         * in 1.16.
         * Used to get the old parser cache entries when available.
+        * @return array
         */
        public static function legacyOptions() {
                global $wgUseDynamicDates;
index 2d99a3b..0d597e8 100644 (file)
@@ -60,6 +60,7 @@ class CacheTime {
         * The value returned by getCacheExpiry is smaller or equal to the smallest number
         * that was provided to a call of updateCacheExpiry(), and smaller or equal to the
         * value of $wgParserCacheExpireTime.
+        * @return int|mixed|null
         */
        function getCacheExpiry() {
                global $wgParserCacheExpireTime;
@@ -166,6 +167,7 @@ class ParserOutput extends CacheTime {
        /**
         * callback used by getText to replace editsection tokens
         * @private
+        * @return mixed
         */
        function replaceEditSectionLinksCallback( $m ) {
                global $wgOut, $wgLang;
index 066589f..54079ac 100644 (file)
@@ -1250,6 +1250,7 @@ class PPFrame_DOM implements PPFrame {
 
        /**
         * Virtual implode with brackets
+        * @return array
         */
        function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
                $args = array_slice( func_get_args(), 3 );
@@ -1674,6 +1675,7 @@ class PPNode_DOM implements PPNode {
 
        /**
         * Split a <h> node
+        * @return array
         */
        function splitHeading() {
                if ( $this->getName() !== 'h' ) {
index 3d1a017..b1ed9b6 100644 (file)
@@ -205,6 +205,7 @@ class Profiler {
 
        /**
         * Returns a tree of function call instead of a list of functions
+        * @return string
         */
        function getCallTree() {
                return implode( '', array_map( array( &$this, 'getCallTreeLine' ), $this->remapCallTree( $this->mStack ) ) );
@@ -214,6 +215,7 @@ class Profiler {
         * Recursive function the format the current profiling array into a tree
         *
         * @param $stack array profiling array
+        * @return array
         */
        function remapCallTree( $stack ) {
                if( count( $stack ) < 2 ){
@@ -252,6 +254,7 @@ class Profiler {
 
        /**
         * Callback to get a formatted line for the call tree
+        * @return string
         */
        function getCallTreeLine( $entry ) {
                list( $fname, $level, $start, /* $x */, $end)  = $entry;
@@ -494,6 +497,7 @@ class Profiler {
 
        /**
         * Get the function name of the current profiling section
+        * @return
         */
        function getCurrentSection() {
                $elt = end( $this->mWorkStack );