Even more documentation in various files
authorSam Reed <reedy@users.mediawiki.org>
Sun, 29 May 2011 14:24:27 +0000 (14:24 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 29 May 2011 14:24:27 +0000 (14:24 +0000)
16 files changed:
includes/Block.php
includes/ConfEditor.php
includes/ExternalStore.php
includes/GlobalFunctions.php
includes/HttpFunctions.php
includes/ImageFunctions.php
includes/Import.php
includes/actions/DeleteAction.php
includes/api/ApiFormatXml.php
includes/api/ApiPageSet.php
includes/cache/LinkBatch.php
includes/db/LBFactory_Single.php
includes/filerepo/LocalRepo.php
includes/job/DoubleRedirectJob.php
includes/media/BitmapMetadataHandler.php
includes/objectcache/DBABagOStuff.php

index 3bcab54..25b02ff 100644 (file)
@@ -94,7 +94,6 @@ class Block {
         *
         * @param $address String: IP address of user/anon
         * @param $user Integer: user id of user
-        * @param $killExpired Boolean: delete expired blocks on load
         * @return Block Object
         * @deprecated since 1.18
         */
index 5294684..3604ee8 100644 (file)
@@ -84,6 +84,10 @@ class ConfEditor {
 
        /**
         * Simple entry point for command-line testing
+        *
+        * @param $text string
+        *
+        * @return string
         */
        static function test( $text ) {
                try {
index d1cf4a5..3bee6ed 100644 (file)
@@ -78,7 +78,10 @@ class ExternalStore {
         * Store a data item to an external store, identified by a partial URL
         * The protocol part is used to identify the class, the rest is passed to the
         * class itself as a parameter.
-        * @return string The URL of the stored data item, or false on error
+        * @param $url
+        * @param $data
+        * @param $params array
+        * @return string|false The URL of the stored data item, or false on error
         */
        static function insert( $url, $data, $params = array() ) {
                list( $proto, $params ) = explode( '://', $url, 2 );
index f91505c..17f9350 100644 (file)
@@ -86,6 +86,11 @@ function wfArrayDiff2( $a, $b ) {
        return array_udiff( $a, $b, 'wfArrayDiff2_cmp' );
 }
 
+/**
+ * @param $a
+ * @param $b
+ * @return int
+ */
 function wfArrayDiff2_cmp( $a, $b ) {
        if ( !is_array( $a ) ) {
                return strcmp( $a, $b );
index 1ec083c..56f864c 100644 (file)
@@ -53,6 +53,8 @@ class Http {
        /**
         * Simple wrapper for Http::request( 'GET' )
         * @see Http::request()
+        *
+        * @return string
         */
        public static function get( $url, $timeout = 'default', $options = array() ) {
                $options['timeout'] = $timeout;
@@ -62,6 +64,8 @@ class Http {
        /**
         * Simple wrapper for Http::request( 'POST' )
         * @see Http::request()
+        *
+        * @return string
         */
        public static function post( $url, $options = array() ) {
                return Http::request( 'POST', $url, $options );
index 2af77dd..d048a9d 100644 (file)
@@ -15,7 +15,7 @@
  *      i.e. articles where the image may occur inline.
  *
  * @param $name string the image name to check
- * @param $contextTitle Title the page on which the image occurs, if known
+ * @param $contextTitle Title|bool the page on which the image occurs, if known
  * @return bool
  */
 function wfIsBadImage( $name, $contextTitle = false ) {
index 1e6df49..3a2c19c 100644 (file)
@@ -39,7 +39,7 @@ class WikiImporter {
 
        /**
         * Creates an ImportXMLReader drawing from the source provided
-       */
+        */
        function __construct( $source ) {
                $this->reader = new XMLReader();
 
index 87b3c1c..9f4d8cc 100644 (file)
@@ -39,6 +39,8 @@ class DeleteAction extends Action {
         * check that the page is not too big and has not already been deleted.
         * @throws ErrorPageError
         * @see Action::checkCanExecute
+        *
+        * @param $user User
         */
        protected function checkCanExecute( User $user ){
 
index 3f39eb9..d76224b 100644 (file)
@@ -86,6 +86,13 @@ class ApiFormatXml extends ApiFormatBase {
         *
         * If neither key is found, all keys become element names, and values become element content.
         * The method is recursive, so the same rules apply to any sub-arrays.
+        * 
+        * @param $elemName
+        * @param $elemValue
+        * @param $indent
+        * @param $doublequote bool
+        *
+        * @return string
         */
        public static function recXmlPrint( $elemName, $elemValue, $indent, $doublequote = false ) {
                $retval = '';
index fdee6fe..caa1dc0 100644 (file)
@@ -59,6 +59,7 @@ class ApiPageSet extends ApiQueryBase {
         * Constructor
         * @param $query ApiQuery
         * @param $resolveRedirects bool Whether redirects should be resolved
+        * @param $convertTitles bool
         */
        public function __construct( $query, $resolveRedirects = false, $convertTitles = false ) {
                parent::__construct( $query, 'query' );
index e6f101d..0bd869f 100644 (file)
@@ -59,6 +59,8 @@ class LinkBatch {
        /**
         * Set the link list to a given 2-d array
         * First key is the namespace, second is the DB key, value arbitrary
+        *
+        * @param $array array
         */
        public function setArray( $array ) {
                $this->data = $array;
@@ -66,6 +68,8 @@ class LinkBatch {
 
        /**
         * Returns true if no pages have been added, false otherwise.
+        *
+        * @return bool
         */
        public function isEmpty() {
                return ($this->getSize() == 0);
@@ -73,6 +77,8 @@ class LinkBatch {
 
        /**
         * Returns the size of the batch.
+        *
+        * @return int
         */
        public function getSize() {
                return count( $this->data );
@@ -82,10 +88,10 @@ class LinkBatch {
         * Do the query and add the results to the LinkCache object
         * Return an array mapping PDBK to ID
         */
-        public function execute() {
-               $linkCache = LinkCache::singleton();
-               return $this->executeInto( $linkCache );
-        }
+       public function execute() {
+               $linkCache = LinkCache::singleton();
+               return $this->executeInto( $linkCache );
+       }
 
        /**
         * Do the query and add the results to a given LinkCache object
@@ -105,6 +111,9 @@ class LinkBatch {
         * As normal, titles will go into the static Title cache field.
         * This function *also* stores extra fields of the title used for link
         * parsing to avoid extra DB queries.
+        *
+        * @param $cache
+        * @param $res
         */
        public function addResultToCache( $cache, $res ) {
                if ( !$res ) {
index 5ccaa15..89b4132 100644 (file)
@@ -86,8 +86,8 @@ class LoadBalancer_Single extends LoadBalancer {
 
        /**
         *
-        * @param $server
-        * @param $dbNameOverride
+        * @param $server string
+        * @param $dbNameOverride bool
         *
         * @return DatabaseBase
         */
index 34d07ef..f3a15d9 100644 (file)
@@ -49,13 +49,16 @@ class LocalRepo extends FSRepo {
         * filearchive table. This needs to be done in the repo because it needs to
         * interleave database locks with file operations, which is potentially a
         * remote operation.
+        *
+        * @param $storageKeys array
+        *
         * @return FileRepoStatus
         */
        function cleanupDeletedBatch( $storageKeys ) {
                $root = $this->getZonePath( 'deleted' );
                $dbw = $this->getMasterDB();
                $status = $this->newGood();
-               $storageKeys = array_unique($storageKeys);
+               $storageKeys = array_unique( $storageKeys );
                foreach ( $storageKeys as $key ) {
                        $hashPath = $this->getDeletedHashPath( $key );
                        $path = "$root/$hashPath$key";
index 6b76734..d7991f5 100644 (file)
@@ -23,7 +23,7 @@ class DoubleRedirectJob extends Job {
         * Insert jobs into the job queue to fix redirects to the given title
         * @param $reason String: the reason for the fix, see message double-redirect-fixed-<reason>
         * @param $redirTitle Title: the title which has changed, redirects pointing to this title are fixed
-        * @param $destTitle Not used
+        * @param $destTitle bool Not used
         */
        public static function fixRedirects( $reason, $redirTitle, $destTitle = false ) {
                # Need to use the master to get the redirect table updated in the same transaction
index 2a512f7..13188ec 100644 (file)
@@ -109,11 +109,11 @@ class BitmapMetadataHandler {
        }
 
        /** Main entry point for jpeg's.
-       *
-       * @param string $file filename (with full path)
-       * @return metadata result array.
-       * @throws MWException on invalid file.
-       */
+        *
+        * @param $filename string filename (with full path)
+        * @return metadata result array.
+        * @throws MWException on invalid file.
+        */
        static function Jpeg ( $filename ) {
                $showXMP = function_exists( 'xml_parser_create_ns' );
                $meta = new self();
@@ -143,14 +143,15 @@ class BitmapMetadataHandler {
                }
                return $meta->getMetadataArray();
        }
+
        /** Entry point for png
-       * At some point in the future this might
-       * merge the png various tEXt chunks to that
-       * are interesting, but for now it only does XMP
-       *
-       * @param $filename String full path to file
-       * @return Array Array for storage in img_metadata.
-       */
+        * At some point in the future this might
+        * merge the png various tEXt chunks to that
+        * are interesting, but for now it only does XMP
+        *
+        * @param $filename String full path to file
+        * @return Array Array for storage in img_metadata.
+        */
        static public function PNG ( $filename ) {
                $showXMP = function_exists( 'xml_parser_create_ns' );
 
index 58c434c..783cd22 100644 (file)
@@ -27,6 +27,8 @@ class DBABagOStuff extends BagOStuff {
 
        /**
         * Encode value and expiry for storage
+        * @param $value
+        * @param $expiry
         *
         * @return string
         */