More documentation
authorSam Reed <reedy@users.mediawiki.org>
Sat, 29 Oct 2011 01:53:28 +0000 (01:53 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 29 Oct 2011 01:53:28 +0000 (01:53 +0000)
includes/Article.php
includes/CategoryViewer.php
includes/Cdb_PHP.php
includes/FileDeleteForm.php
includes/HttpFunctions.php
includes/ImagePage.php
includes/Import.php
includes/LinksUpdate.php
includes/cache/CacheDependency.php

index 46d26bc..b75f4da 100644 (file)
@@ -33,7 +33,6 @@ class Article extends Page {
        protected $mPage;
 
        /**
-        * @protected
         * @var ParserOptions: ParserOptions object for $wgUser articles
         */
        public $mParserOptions;
@@ -1091,6 +1090,10 @@ class Article extends Page {
                }
 
                // the loop prepends the arrow image before the link, so the first case needs to be outside
+
+               /**
+                * @var $title Title
+                */
                $title = array_shift( $target );
 
                if ( $forceKnown ) {
@@ -1521,6 +1524,8 @@ class Article extends Page {
 
        /**
         * Perform a deletion and output success or failure messages
+        * @param $reason
+        * @param $suppress bool
         */
        public function doDelete( $reason, $suppress = false ) {
                global $wgOut;
@@ -2044,21 +2049,21 @@ class Article extends Page {
         * @param $title Title
         */
        public static function onArticleCreate( $title ) {
-               return WikiPage::onArticleCreate( $title );
+               WikiPage::onArticleCreate( $title );
        }
 
        /**
         * @param $title Title
         */
        public static function onArticleDelete( $title ) {
-               return WikiPage::onArticleDelete( $title );
+               WikiPage::onArticleDelete( $title );
        }
 
        /**
         * @param $title Title
         */
        public static function onArticleEdit( $title ) {
-               return WikiPage::onArticleEdit( $title );
+               WikiPage::onArticleEdit( $title );
        }
 
        /**
@@ -2087,10 +2092,16 @@ class PoolWorkArticleView extends PoolCounterWork {
                $this->parserOptions = $parserOptions;
        }
 
+       /**
+        * @return bool
+        */
        function doWork() {
                return $this->mArticle->doViewParse();
        }
 
+       /**
+        * @return bool
+        */
        function getCachedWork() {
                global $wgOut;
 
@@ -2108,6 +2119,9 @@ class PoolWorkArticleView extends PoolCounterWork {
                return false;
        }
 
+       /**
+        * @return bool
+        */
        function fallback() {
                return $this->mArticle->tryDirtyCache();
        }
index b66beae..c64bb73 100644 (file)
@@ -133,6 +133,9 @@ class CategoryViewer extends ContextSource {
 
        /**
         * Add a subcategory to the internal lists, using a Category object
+        * @param $cat Category
+        * @param $sortkey
+        * @param $pageLength
         */
        function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
                // Subcategory; strip the 'Category' namespace from the link text.
@@ -185,6 +188,10 @@ class CategoryViewer extends ContextSource {
 
        /**
         * Add a page in the image namespace
+        * @param $title Title
+        * @param $sortkey
+        * @param $pageLength
+        * @param $isRedirect bool
         */
        function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
                global $wgContLang;
@@ -211,6 +218,10 @@ class CategoryViewer extends ContextSource {
 
        /**
         * Add a miscellaneous page
+        * @param $title
+        * @param $sortkey
+        * @param $pageLength
+        * @param $isRedirect bool
         */
        function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
                global $wgContLang;
@@ -316,6 +327,9 @@ class CategoryViewer extends ContextSource {
                }
        }
 
+       /**
+        * @return string
+        */
        function getCategoryTop() {
                $r = $this->getCategoryBottom();
                return $r === ''
@@ -323,6 +337,9 @@ class CategoryViewer extends ContextSource {
                        : "<br style=\"clear:both;\"/>\n" . $r;
        }
 
+       /**
+        * @return string
+        */
        function getSubcategorySection() {
                # Don't show subcategories section if there are none.
                $r = '';
@@ -343,6 +360,9 @@ class CategoryViewer extends ContextSource {
                return $r;
        }
 
+       /**
+        * @return string
+        */
        function getPagesSection() {
                $ti = htmlspecialchars( $this->title->getText() );
                # Don't show articles section if there are none.
@@ -369,6 +389,9 @@ class CategoryViewer extends ContextSource {
                return $r;
        }
 
+       /**
+        * @return string
+        */
        function getImageSection() {
                $r = '';
                $rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery );
@@ -408,6 +431,9 @@ class CategoryViewer extends ContextSource {
                }
        }
 
+       /**
+        * @return string
+        */
        function getCategoryBottom() {
                return '';
        }
@@ -567,6 +593,7 @@ class CategoryViewer extends ContextSource {
         *
         * @param Title $title: The title (usually $this->title)
         * @param String $section: Which section
+        * @return Title
         */
        private function addFragmentToTitle( $title, $section ) {
                switch ( $section ) {
index f4029ba..aaaf33a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that 
+ * This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
  * appears in PHP 5.3. Changes are:
  *    * Error returns replaced with exceptions
  *    * Exception thrown if sizes or offsets are between 2GB and 4GB
@@ -50,7 +50,7 @@ class CdbFunctions {
 
        /**
         * The CDB hash function.
-        * 
+        *
         * @param $s
         *
         * @return
@@ -62,7 +62,7 @@ class CdbFunctions {
                        // Do a 32-bit sum
                        // Inlined here for speed
                        $sum = ($h & 0x3fffffff) + ($h5 & 0x3fffffff);
-                       $h = 
+                       $h =
                                (
                                        ( $sum & 0x40000000 ? 1 : 0 )
                                        + ( $h & 0x80000000 ? 2 : 0 )
@@ -104,8 +104,11 @@ class CdbReader_PHP extends CdbReader {
        var $dpos;
 
        /* initialized if cdb_findnext() returns 1 */
-       var $dlen; 
+       var $dlen;
 
+       /**
+        * @param $fileName string
+        */
        function __construct( $fileName ) {
                $this->handle = fopen( $fileName, 'rb' );
                if ( !$this->handle ) {
@@ -257,8 +260,11 @@ class CdbWriter_PHP extends CdbWriter {
        var $handle, $realFileName, $tmpFileName;
 
        var $hplist;
-       var $numEntries, $pos;
+       var $numentries, $pos;
 
+       /**
+        * @param $fileName string
+        */
        function __construct( $fileName ) {
                $this->realFileName = $fileName;
                $this->tmpFileName = $fileName . '.tmp.' . mt_rand( 0, 0x7fffffff );
@@ -391,7 +397,7 @@ class CdbWriter_PHP extends CdbWriter {
                }
 
                // Excessively clever and indulgent code to simultaneously fill $packedTables
-               // with the packed hashtables, and adjust the elements of $starts 
+               // with the packed hashtables, and adjust the elements of $starts
                // to actually point to the starts instead of the ends.
                $packedTables = array_fill( 0, $this->numentries, false );
                foreach ( $this->hplist as $item ) {
@@ -416,7 +422,7 @@ class CdbWriter_PHP extends CdbWriter {
                        // is taken.
                        for ( $u = 0; $u < $count; ++$u ) {
                                $hp = $packedTables[$starts[$i] + $u];
-                               $where = CdbFunctions::unsignedMod( 
+                               $where = CdbFunctions::unsignedMod(
                                        CdbFunctions::unsignedShiftRight( $hp['h'], 8 ), $len );
                                while ( $hashtable[$where]['p'] )
                                        if ( ++$where == $len )
@@ -426,7 +432,7 @@ class CdbWriter_PHP extends CdbWriter {
 
                        // Write the hashtable
                        for ( $u = 0; $u < $len; ++$u ) {
-                               $buf = pack( 'vvV', 
+                               $buf = pack( 'vvV',
                                        $hashtable[$u]['h'] & 0xffff,
                                        CdbFunctions::unsignedShiftRight( $hashtable[$u]['h'], 16 ),
                                        $hashtable[$u]['p'] );
index 97ac28e..0c5e232 100644 (file)
@@ -8,12 +8,23 @@
  */
 class FileDeleteForm {
 
+       /**
+        * @var Title
+        */
        private $title = null;
+
+       /**
+        * @var File
+        */
        private $file = null;
 
+       /**
+        * @var File
+        */
        private $oldfile = null;
        private $oldimage = '';
 
+       private $DeleteReason, $DeleteReasonList;
        /**
         * Constructor
         *
@@ -295,6 +306,9 @@ class FileDeleteForm {
         * value was provided, does it correspond to an
         * existing, local, old version of this file?
         *
+        * @param $file File
+        * @param $oldfile File
+        * @param $oldimage File
         * @return bool
         */
        public static function haveDeletableFile(&$file, &$oldfile, $oldimage) {
index 47dc682..2ec7ea1 100644 (file)
@@ -53,6 +53,9 @@ class Http {
         * Simple wrapper for Http::request( 'GET' )
         * @see Http::request()
         *
+        * @param $url
+        * @param $timeout string
+        * @param $options array
         * @return string
         */
        public static function get( $url, $timeout = 'default', $options = array() ) {
@@ -64,6 +67,8 @@ class Http {
         * Simple wrapper for Http::request( 'POST' )
         * @see Http::request()
         *
+        * @param $url
+        * @param $options array
         * @return string
         */
        public static function post( $url, $options = array() ) {
@@ -221,6 +226,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())
+        * @return \CurlHttpRequest|\PhpHttpRequest
         * @see MWHttpRequest::__construct
         */
        public static function factory( $url, $options = null ) {
@@ -295,6 +301,7 @@ class MWHttpRequest {
 
        /**
         * Set the user agent
+        * @param $UA string
         */
        public function setUserAgent( $UA ) {
                $this->setHeader( 'User-Agent', $UA );
@@ -302,6 +309,8 @@ class MWHttpRequest {
 
        /**
         * Set an arbitrary header
+        * @param $name
+        * @param $value
         */
        public function setHeader( $name, $value ) {
                // I feel like I should normalize the case here...
@@ -310,6 +319,7 @@ class MWHttpRequest {
 
        /**
         * Get an array of the headers
+        * @return array
         */
        public function getHeaderList() {
                $list = array();
@@ -540,6 +550,9 @@ class MWHttpRequest {
         * cookies.      Used internally after a request to parse the
         * Set-Cookie headers.
         * @see Cookie::set
+        * @param $name
+        * @param $value null
+        * @param $attr null
         */
        public function setCookie( $name, $value = null, $attr = null ) {
                if ( !$this->cookieJar ) {
@@ -614,6 +627,7 @@ class MWHttpRequest {
        /**
         * Returns true if the backend can follow redirects. Overridden by the
         * child classes.
+        * @return bool
         */
        public function canFollowRedirects() {
                return true;
@@ -634,6 +648,11 @@ class CurlHttpRequest extends MWHttpRequest {
        protected $curlOptions = array();
        protected $headerText = "";
 
+       /**
+        * @param $fh
+        * @param $content
+        * @return int
+        */
        protected function readHeader( $fh, $content ) {
                $this->headerText .= $content;
                return strlen( $content );
@@ -725,6 +744,9 @@ class CurlHttpRequest extends MWHttpRequest {
                return $this->status;
        }
 
+       /**
+        * @return bool
+        */
        public function canFollowRedirects() {
                if ( strval( ini_get( 'open_basedir' ) ) !== '' || wfIniGetBool( 'safe_mode' ) ) {
                        wfDebug( "Cannot follow redirects in safe mode\n" );
@@ -741,6 +763,11 @@ class CurlHttpRequest extends MWHttpRequest {
 }
 
 class PhpHttpRequest extends MWHttpRequest {
+
+       /**
+        * @param $url string
+        * @return string
+        */
        protected function urlToTcp( $url ) {
                $parsedUrl = parse_url( $url );
 
index 8bd94ee..fb25284 100644 (file)
@@ -188,6 +188,9 @@ class ImagePage extends Article {
                $wgOut->addModuleStyles( 'filepage' );
        }
 
+       /**
+        * @return File
+        */
        public function getDisplayedFile() {
                $this->loadFile();
                return $this->displayImg;
@@ -247,6 +250,7 @@ class ImagePage extends Article {
         *
         * Omit noarticletext if sharedupload; text will be fetched from the
         * shared upload server if possible.
+        * @return string
         */
        public function getContent() {
                $this->loadFile();
@@ -398,7 +402,7 @@ class ImagePage extends Article {
                                                'action' => $wgScript,
                                                'onchange' => 'document.pageselector.submit();',
                                        );
-
+                                       $options = array();
                                        for ( $i = 1; $i <= $count; $i++ ) {
                                                $options[] = Xml::option( $wgLang->formatNum( $i ), $i, $i == $page );
                                        }
@@ -484,9 +488,10 @@ EOT
 
        /**
         * Creates an thumbnail of specified size and returns an HTML link to it
-        * @param array $params Scaler parameters
-        * @param int $width
-        * @param int $height
+        * @param $params array Scaler parameters
+        * @param $width int
+        * @param $height int
+        * @return string
         */
        private function makeSizeLink( $params, $width, $height ) {
                $params['width'] = $width;
@@ -615,6 +620,11 @@ EOT
                }
        }
 
+       /**
+        * @param $target
+        * @param $limit
+        * @return ResultWrapper
+        */
        protected function queryImageLinks( $target, $limit ) {
                $dbr = wfGetDB( DB_SLAVE );
 
@@ -747,6 +757,9 @@ EOT
                );
                $wgOut->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );
 
+               /**
+                * @var $file File
+                */
                foreach ( $dupes as $file ) {
                        $fromSrc = '';
                        if ( $file->isLocal() ) {
@@ -841,6 +854,11 @@ class ImageHistoryList {
         */
        protected $imagePage;
 
+       /**
+        * @var File
+        */
+       protected $current;
+
        protected $repo, $showThumb;
        protected $preventClickjacking = false;
 
@@ -856,14 +874,24 @@ class ImageHistoryList {
                $this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender();
        }
 
+       /**
+        * @return ImagePage
+        */
        public function getImagePage() {
                return $this->imagePage;
        }
 
+       /**
+        * @return File
+        */
        public function getFile() {
                return $this->img;
        }
 
+       /**
+        * @param $navLinks string
+        * @return string
+        */
        public function beginImageHistoryList( $navLinks = '' ) {
                global $wgOut, $wgUser;
                return Xml::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) ) . "\n"
@@ -881,6 +909,10 @@ class ImageHistoryList {
                        . "</tr>\n";
        }
 
+       /**
+        * @param $navLinks string
+        * @return string
+        */
        public function endImageHistoryList( $navLinks = '' ) {
                return "</table>\n$navLinks\n</div>\n";
        }
@@ -1071,10 +1103,16 @@ class ImageHistoryList {
                }
        }
 
+       /**
+        * @param $enable bool
+        */
        protected function preventClickjacking( $enable = true ) {
                $this->preventClickjacking = $enable;
        }
 
+       /**
+        * @return bool
+        */
        public function getPreventClickjacking() {
                return $this->preventClickjacking;
        }
@@ -1106,6 +1144,9 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                $this->mRange = array( 0, 0 ); // display range
        }
 
+       /**
+        * @return Title
+        */
        function getTitle() {
                return $this->mTitle;
        }
@@ -1114,14 +1155,23 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                return false;
        }
 
+       /**
+        * @return string
+        */
        function getIndexField() {
                return '';
        }
 
+       /**
+        * @return string
+        */
        function formatRow( $row ) {
                return '';
        }
 
+       /**
+        * @return string
+        */
        function getBody() {
                $s = '';
                $this->doQuery();
@@ -1225,10 +1275,16 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                $this->mQueryDone = true;
        }
 
+       /**
+        * @param $enable bool
+        */
        protected function preventClickjacking( $enable = true ) {
                $this->preventClickjacking = $enable;
        }
 
+       /**
+        * @return bool
+        */
        public function getPreventClickjacking() {
                return $this->preventClickjacking;
        }
index dfbd522..6eec5c9 100644 (file)
@@ -40,6 +40,7 @@ class WikiImporter {
 
        /**
         * Creates an ImportXMLReader drawing from the source provided
+        * @param $source
         */
        function __construct( $source ) {
                $this->reader = new XMLReader();
@@ -48,8 +49,7 @@ class WikiImporter {
                $id = UploadSourceAdapter::registerSource( $source );
                if (defined( 'LIBXML_PARSEHUGE' ) ) {
                        $this->reader->open( "uploadsource://$id", null, LIBXML_PARSEHUGE );
-               }
-               else {
+               } else {
                        $this->reader->open( "uploadsource://$id" );
                }
 
@@ -87,6 +87,7 @@ class WikiImporter {
 
        /**
         * Set debug mode...
+        * @param $debug bool
         */
        function setDebug( $debug ) {
                $this->mDebug = $debug;
@@ -94,6 +95,7 @@ class WikiImporter {
 
        /**
         * Set 'no updates' mode. In this mode, the link tables will not be updated by the importer
+        * @param $noupdates bool
         */
        function setNoUpdates( $noupdates ) {
                $this->mNoUpdates = $noupdates;
@@ -171,6 +173,8 @@ class WikiImporter {
 
        /**
         * Set a target namespace to override the defaults
+        * @param $namespace
+        * @return bool
         */
        public function setTargetNamespace( $namespace ) {
                if( is_null( $namespace ) ) {
@@ -185,7 +189,7 @@ class WikiImporter {
        }
 
        /**
-        * @parma $dir
+        * @param $dir
         */
        public function setImageBasePath( $dir ) {
                $this->mImageBasePath = $dir;
@@ -201,6 +205,7 @@ class WikiImporter {
        /**
         * Default per-revision callback, performs the import.
         * @param $revision WikiRevision
+        * @return bool
         */
        public function importRevision( $revision ) {
                $dbw = wfGetDB( DB_MASTER );
@@ -210,6 +215,7 @@ class WikiImporter {
        /**
         * Default per-revision callback, performs the import.
         * @param $rev WikiRevision
+        * @return bool
         */
        public function importLogItem( $rev ) {
                $dbw = wfGetDB( DB_MASTER );
@@ -218,6 +224,8 @@ class WikiImporter {
 
        /**
         * Dummy for now...
+        * @param $revision
+        * @return bool
         */
        public function importUpload( $revision ) {
                $dbw = wfGetDB( DB_MASTER );
@@ -226,6 +234,12 @@ class WikiImporter {
 
        /**
         * Mostly for hook use
+        * @param $title
+        * @param $origTitle
+        * @param $revCount
+        * @param $sRevCount
+        * @param $pageInfo
+        * @return
         */
        public function finishImportPage( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) {
                $args = func_get_args();
@@ -930,6 +944,10 @@ class XMLReader2 extends XMLReader {
  */
 class WikiRevision {
        var $importer = null;
+
+       /**
+        * @var Title
+        */
        var $title = null;
        var $id = 0;
        var $timestamp = "20010115000000";
@@ -945,6 +963,7 @@ class WikiRevision {
        var $sha1base36 = false;
        var $isTemp = false;
        var $archiveName = '';
+       var $fileIsTemp;
        private $mNoUpdates = false;
 
        /**
@@ -1062,6 +1081,9 @@ class WikiRevision {
                $this->type = $type;
        }
 
+       /**
+        * @param $action
+        */
        function setAction( $action ) {
                $this->action = $action;
        }
@@ -1428,10 +1450,16 @@ class ImportStringSource {
                $this->mRead = false;
        }
 
+       /**
+        * @return bool
+        */
        function atEnd() {
                return $this->mRead;
        }
 
+       /**
+        * @return bool|string
+        */
        function readChunk() {
                if( $this->atEnd() ) {
                        return false;
@@ -1457,6 +1485,9 @@ class ImportStreamSource {
                return feof( $this->mHandle );
        }
 
+       /**
+        * @return string
+        */
        function readChunk() {
                return fread( $this->mHandle, 32768 );
        }
index 7eafc4a..ea90b34 100644 (file)
@@ -297,14 +297,17 @@ class LinksUpdate {
                );
        }
 
+       /**
+        * @param $cats
+        */
        function invalidateCategories( $cats ) {
                $this->invalidatePages( NS_CATEGORY, array_keys( $cats ) );
        }
 
        /**
         * Update all the appropriate counts in the category table.
-        * @param $added associative array of category name => sort key
-        * @param $deleted associative array of category name => sort key
+        * @param $added array associative array of category name => sort key
+        * @param $deleted array associative array of category name => sort key
         */
        function updateCategoryCounts( $added, $deleted ) {
                $a = new Article($this->mTitle);
@@ -313,10 +316,18 @@ class LinksUpdate {
                );
        }
 
+       /**
+        * @param $images
+        */
        function invalidateImageDescriptions( $images ) {
                $this->invalidatePages( NS_FILE, array_keys( $images ) );
        }
 
+       /**
+        * @param $table
+        * @param $insertions
+        * @param $fromField
+        */
        function dumbTableUpdate( $table, $insertions, $fromField ) {
                $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
                if ( count( $insertions ) ) {
@@ -329,7 +340,10 @@ class LinksUpdate {
 
        /**
         * Update a table by doing a delete query then an insert query
-        *
+        * @param $table
+        * @param $prefix
+        * @param $deletions
+        * @param $insertions
         */
        function incrTableUpdate( $table, $prefix, $deletions, $insertions ) {
                if ( $table == 'page_props' ) {
@@ -372,11 +386,11 @@ class LinksUpdate {
                }
        }
 
-
        /**
         * Get an array of pagelinks insertions for passing to the DB
         * Skips the titles specified by the 2-D array $existing
-        *
+        * @param $existing array
+        * @return array
         */
        function getLinkInsertions( $existing = array() ) {
                $arr = array();
@@ -397,7 +411,8 @@ class LinksUpdate {
 
        /**
         * Get an array of template insertions. Like getLinkInsertions()
-        *
+        * @param $existing array
+        * @return array
         */
        function getTemplateInsertions( $existing = array() ) {
                $arr = array();
@@ -417,6 +432,8 @@ class LinksUpdate {
        /**
         * Get an array of image insertions
         * Skips the names specified in $existing
+        * @param $existing array
+        * @return array
         */
        function getImageInsertions( $existing = array() ) {
                $arr = array();
@@ -432,6 +449,8 @@ class LinksUpdate {
 
        /**
         * Get an array of externallinks insertions. Skips the names specified in $existing
+        * @param $existing array
+        * @return array
         */
        function getExternalInsertions( $existing = array() ) {
                $arr = array();
@@ -449,8 +468,10 @@ class LinksUpdate {
        /**
         * Get an array of category insertions
         *
-        * @param $existing Array mapping existing category names to sort keys. If both
+        * @param $existing array mapping existing category names to sort keys. If both
         * match a link in $this, the link will be omitted from the output
+        *
+        * @return array
         */
        function getCategoryInsertions( $existing = array() ) {
                global $wgContLang, $wgCategoryCollation;
@@ -493,6 +514,7 @@ class LinksUpdate {
         *
         * @param $existing Array mapping existing language codes to titles
         *
+        * @return array
         */
        function getInterlangInsertions( $existing = array() ) {
                $diffs = array_diff_assoc( $this->mInterlangs, $existing );
@@ -509,6 +531,8 @@ class LinksUpdate {
 
        /**
         * Get an array of page property insertions
+        * @param $existing array
+        * @return array
         */
        function getPropertyInsertions( $existing = array() ) {
                $diffs = array_diff_assoc( $this->mProperties, $existing );
@@ -526,7 +550,8 @@ class LinksUpdate {
        /**
         * Get an array of interwiki insertions for passing to the DB
         * Skips the titles specified by the 2-D array $existing
-        *
+        * @param $existing array
+        * @return array
         */
        function getInterwikiInsertions( $existing = array() ) {
                $arr = array();
@@ -546,7 +571,8 @@ class LinksUpdate {
        /**
         * Given an array of existing links, returns those links which are not in $this
         * and thus should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getLinkDeletions( $existing ) {
                $del = array();
@@ -563,7 +589,8 @@ class LinksUpdate {
        /**
         * Given an array of existing templates, returns those templates which are not in $this
         * and thus should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getTemplateDeletions( $existing ) {
                $del = array();
@@ -580,7 +607,8 @@ class LinksUpdate {
        /**
         * Given an array of existing images, returns those images which are not in $this
         * and thus should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getImageDeletions( $existing ) {
                return array_diff_key( $existing, $this->mImages );
@@ -589,7 +617,8 @@ class LinksUpdate {
        /**
         * Given an array of existing external links, returns those links which are not
         * in $this and thus should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getExternalDeletions( $existing ) {
                return array_diff_key( $existing, $this->mExternals );
@@ -598,7 +627,8 @@ class LinksUpdate {
        /**
         * Given an array of existing categories, returns those categories which are not in $this
         * and thus should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getCategoryDeletions( $existing ) {
                return array_diff_assoc( $existing, $this->mCategories );
@@ -607,7 +637,8 @@ class LinksUpdate {
        /**
         * Given an array of existing interlanguage links, returns those links which are not
         * in $this and thus should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getInterlangDeletions( $existing ) {
                return array_diff_assoc( $existing, $this->mInterlangs );
@@ -615,7 +646,8 @@ class LinksUpdate {
 
        /**
         * Get array of properties which should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getPropertyDeletions( $existing ) {
                return array_diff_assoc( $existing, $this->mProperties );
@@ -624,7 +656,8 @@ class LinksUpdate {
        /**
         * Given an array of existing interwiki links, returns those links which are not in $this
         * and thus should be deleted.
-        *
+        * @param $existing array
+        * @return array
         */
        function getInterwikiDeletions( $existing ) {
                $del = array();
@@ -641,6 +674,7 @@ class LinksUpdate {
        /**
         * Get an array of existing links, as a 2-D array
         *
+        * @return array
         */
        function getExistingLinks() {
                $res = $this->mDb->select( 'pagelinks', array( 'pl_namespace', 'pl_title' ),
@@ -658,6 +692,7 @@ class LinksUpdate {
        /**
         * Get an array of existing templates, as a 2-D array
         *
+        * @return array
         */
        function getExistingTemplates() {
                $res = $this->mDb->select( 'templatelinks', array( 'tl_namespace', 'tl_title' ),
@@ -675,6 +710,7 @@ class LinksUpdate {
        /**
         * Get an array of existing images, image names in the keys
         *
+        * @return array
         */
        function getExistingImages() {
                $res = $this->mDb->select( 'imagelinks', array( 'il_to' ),
@@ -689,6 +725,7 @@ class LinksUpdate {
        /**
         * Get an array of existing external links, URLs in the keys
         *
+        * @return array
         */
        function getExistingExternals() {
                $res = $this->mDb->select( 'externallinks', array( 'el_to' ),
@@ -703,6 +740,7 @@ class LinksUpdate {
        /**
         * Get an array of existing categories, with the name in the key and sort key in the value.
         *
+        * @return array
         */
        function getExistingCategories() {
                $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey_prefix' ),
@@ -718,6 +756,7 @@ class LinksUpdate {
         * Get an array of existing interlanguage links, with the language code in the key and the
         * title in the value.
         *
+        * @return array
         */
        function getExistingInterlangs() {
                $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
@@ -749,6 +788,7 @@ class LinksUpdate {
        /**
         * Get an array of existing categories, with the name in the key and sort key in the value.
         *
+        * @return array
         */
        function getExistingProperties() {
                $res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ),
@@ -760,9 +800,9 @@ class LinksUpdate {
                return $arr;
        }
 
-
        /**
         * Return the title object of the page being updated
+        * @return Title
         */
        function getTitle() {
                return $this->mTitle;
@@ -770,6 +810,7 @@ class LinksUpdate {
 
        /**
         * Return the list of images used as generated by the parser
+        * @return array
         */
        public function getImages() {
                return $this->mImages;
@@ -777,6 +818,7 @@ class LinksUpdate {
 
        /**
         * Invalidate any necessary link lists related to page property changes
+        * @param $changed
         */
        function invalidateProperties( $changed ) {
                global $wgPagePropLinkInvalidations;
index aa02066..290a857 100644 (file)
@@ -28,6 +28,8 @@ class DependencyWrapper {
 
        /**
         * Returns true if any of the dependencies have expired
+        *
+        * @return bool
         */
        function isExpired() {
                foreach ( $this->deps as $dep ) {
@@ -51,6 +53,7 @@ class DependencyWrapper {
 
        /**
         * Get the user-defined value
+        * @return bool|\Mixed
         */
        function getValue() {
                return $this->value;
@@ -143,6 +146,9 @@ class FileDependency extends CacheDependency {
                $this->timestamp = $timestamp;
        }
 
+       /**
+        * @return array
+        */
        function __sleep() {
                $this->loadDependencyValues();
                return array( 'filename', 'timestamp' );
@@ -265,11 +271,15 @@ class TitleListDependency extends CacheDependency {
 
        /**
         * Construct a dependency on a list of titles
+        * @param $linkBatch LinkBatch
         */
        function __construct( LinkBatch $linkBatch ) {
                $this->linkBatch = $linkBatch;
        }
 
+       /**
+        * @return array
+        */
        function calculateTimestamps() {
                # Initialise values to false
                $timestamps = array();
@@ -314,6 +324,9 @@ class TitleListDependency extends CacheDependency {
                return array( 'timestamps' );
        }
 
+       /**
+        * @return LinkBatch
+        */
        function getLinkBatch() {
                if ( !isset( $this->linkBatch ) ) {
                        $this->linkBatch = new LinkBatch;