From: Sam Reed Date: Sun, 29 May 2011 14:24:27 +0000 (+0000) Subject: Even more documentation in various files X-Git-Tag: 1.31.0-rc.0~29866 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=4065e65d03cb7f0eb0a70a04ed5a4ec345faf6af;p=lhc%2Fweb%2Fwiklou.git Even more documentation in various files --- diff --git a/includes/Block.php b/includes/Block.php index 3bcab5467a..25b02ff889 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -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 */ diff --git a/includes/ConfEditor.php b/includes/ConfEditor.php index 5294684a40..3604ee83bb 100644 --- a/includes/ConfEditor.php +++ b/includes/ConfEditor.php @@ -84,6 +84,10 @@ class ConfEditor { /** * Simple entry point for command-line testing + * + * @param $text string + * + * @return string */ static function test( $text ) { try { diff --git a/includes/ExternalStore.php b/includes/ExternalStore.php index d1cf4a57a8..3bee6ed8ba 100644 --- a/includes/ExternalStore.php +++ b/includes/ExternalStore.php @@ -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 ); diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index f91505c287..17f9350b2c 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 ); diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 1ec083c3f3..56f864c3a7 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -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 ); diff --git a/includes/ImageFunctions.php b/includes/ImageFunctions.php index 2af77dde24..d048a9dd49 100644 --- a/includes/ImageFunctions.php +++ b/includes/ImageFunctions.php @@ -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 ) { diff --git a/includes/Import.php b/includes/Import.php index 1e6df49d06..3a2c19c9a6 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -39,7 +39,7 @@ class WikiImporter { /** * Creates an ImportXMLReader drawing from the source provided - */ + */ function __construct( $source ) { $this->reader = new XMLReader(); diff --git a/includes/actions/DeleteAction.php b/includes/actions/DeleteAction.php index 87b3c1c1a9..9f4d8cc059 100644 --- a/includes/actions/DeleteAction.php +++ b/includes/actions/DeleteAction.php @@ -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 ){ diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index 3f39eb9b43..d76224b92e 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -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 = ''; diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index fdee6fecd2..caa1dc08d6 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -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' ); diff --git a/includes/cache/LinkBatch.php b/includes/cache/LinkBatch.php index e6f101dd8a..0bd869fc4e 100644 --- a/includes/cache/LinkBatch.php +++ b/includes/cache/LinkBatch.php @@ -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 ) { diff --git a/includes/db/LBFactory_Single.php b/includes/db/LBFactory_Single.php index 5ccaa15ffa..89b41321f1 100644 --- a/includes/db/LBFactory_Single.php +++ b/includes/db/LBFactory_Single.php @@ -86,8 +86,8 @@ class LoadBalancer_Single extends LoadBalancer { /** * - * @param $server - * @param $dbNameOverride + * @param $server string + * @param $dbNameOverride bool * * @return DatabaseBase */ diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index 34d07ef600..f3a15d9177 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -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"; diff --git a/includes/job/DoubleRedirectJob.php b/includes/job/DoubleRedirectJob.php index 6b76734ce7..d7991f5e39 100644 --- a/includes/job/DoubleRedirectJob.php +++ b/includes/job/DoubleRedirectJob.php @@ -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- * @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 diff --git a/includes/media/BitmapMetadataHandler.php b/includes/media/BitmapMetadataHandler.php index 2a512f7b10..13188ecf48 100644 --- a/includes/media/BitmapMetadataHandler.php +++ b/includes/media/BitmapMetadataHandler.php @@ -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' ); diff --git a/includes/objectcache/DBABagOStuff.php b/includes/objectcache/DBABagOStuff.php index 58c434c58a..783cd22b38 100644 --- a/includes/objectcache/DBABagOStuff.php +++ b/includes/objectcache/DBABagOStuff.php @@ -27,6 +27,8 @@ class DBABagOStuff extends BagOStuff { /** * Encode value and expiry for storage + * @param $value + * @param $expiry * * @return string */