From 6706fcb62a90bc8c95da59edc29cd02b45d1afab Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 13 Nov 2010 00:32:54 +0000 Subject: [PATCH] Fixed up some doxygen warnings --- includes/api/ApiQueryImageInfo.php | 4 +-- includes/upload/UploadBase.php | 12 ++++----- .../phpunit/includes/api/ApiUploadTest.php | 14 +++++------ .../includes/api/RandomImageGenerator.php | 25 +++++++++---------- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index de4d5f8163..11ec5e07c1 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -180,8 +180,8 @@ class ApiQueryImageInfo extends ApiQueryBase { /** * From parameters, construct a 'scale' array - * @param {Array} $params - * @return {null|Array} key-val array of 'width' and 'height', or null + * @param $params Array: + * @return Array or Null: key-val array of 'width' and 'height', or null */ public function getScale( $params ) { $p = $this->getModulePrefix(); diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 318d50c79d..bfbf12ab88 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -627,8 +627,8 @@ abstract class UploadBase { * This method returns the file object, which also has a 'sessionKey' property which can be passed through a form or * API request to find this stashed file again. * - * @param {String}: $key (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated. - * @return {File}: stashed file + * @param $key String: (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated. + * @return File: stashed file */ public function stashSessionFile( $key = null ) { $stash = new UploadStash(); @@ -644,8 +644,8 @@ abstract class UploadBase { /** * Stash a file in a temporary directory, returning a key which can be used to find the file again. See stashSessionFile(). * - * @param {String}: $key (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated. - * @return {String}: session key + * @param $key String: (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated. + * @return String: session key */ public function stashSession( $key = null ) { return $this->stashSessionFile( $key )->getSessionKey(); @@ -1202,8 +1202,8 @@ abstract class UploadBase { * 'metadata' was requested. Oddly, we have to pass the "result" object down just so it can do that * with the appropriate format, presumably. * - * @param {ApiResult} - * @return {Array} image info + * @param $result ApiResult: + * @return Array: image info */ public function getImageInfo( $result ) { $file = $this->getLocalFile(); diff --git a/maintenance/tests/phpunit/includes/api/ApiUploadTest.php b/maintenance/tests/phpunit/includes/api/ApiUploadTest.php index 88508b3f79..a134dd31c3 100644 --- a/maintenance/tests/phpunit/includes/api/ApiUploadTest.php +++ b/maintenance/tests/phpunit/includes/api/ApiUploadTest.php @@ -578,7 +578,7 @@ class ApiUploadTest extends ApiTestCase { /** * Helper function -- remove files and associated articles by Title - * @param {Title} title to be removed + * @param $title Title: title to be removed */ public function deleteFileByTitle( $title ) { if ( $title->exists() ) { @@ -601,7 +601,7 @@ class ApiUploadTest extends ApiTestCase { /** * Helper function -- remove files and associated articles with a particular filename - * @param {String} filename to be removed + * @param $fileName String: filename to be removed */ public function deleteFileByFileName( $fileName ) { return $this->deleteFileByTitle( Title::newFromText( $fileName, NS_FILE ) ); @@ -610,7 +610,7 @@ class ApiUploadTest extends ApiTestCase { /** * Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them. - * @param {String} path to file on the filesystem + * @param $filePath String: path to file on the filesystem */ public function deleteFileByContent( $filePath ) { $hash = File::sha1Base36( $filePath ); @@ -625,10 +625,10 @@ class ApiUploadTest extends ApiTestCase { /** * Fake an upload by dumping the file into temp space, and adding info to $_FILES. * (This is what PHP would normally do). - * @param {String}: fieldname - name this would have in the upload form - * @param {String}: fileName - name to title this - * @param {String}: mime type - * @param {String}: filePath - path where to find file contents + * @param $fieldName String: name this would have in the upload form + * @param $fileName String: name to title this + * @param $type String: mime type + * @param $filePath String: path where to find file contents */ function fakeUploadFile( $fieldName, $fileName, $type, $filePath ) { $tmpName = tempnam( wfTempDir(), "" ); diff --git a/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php b/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php index e82857b7e1..f544a71129 100644 --- a/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php +++ b/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php @@ -68,10 +68,10 @@ class RandomImageGenerator { /** * Writes random images with random filenames to disk in the directory you specify, or current working directory * - * @param {Integer} number of filenames to write - * @param {String} format, optional, must be understood by ImageMagick, such as 'jpg' or 'gif' - * @param {String} directory, optional (will default to current working directory) - * @return {Array} filenames we just wrote + * @param $number Integer: number of filenames to write + * @param $format String: optional, must be understood by ImageMagick, such as 'jpg' or 'gif' + * @param $dir String: directory, optional (will default to current working directory) + * @return Array: filenames we just wrote */ function writeImages( $number, $format = 'jpg', $dir = null ) { $filenames = $this->getRandomFilenames( $number, $format, $dir ); @@ -85,10 +85,10 @@ class RandomImageGenerator { * Return a number of randomly-generated filenames * Each filename uses two words randomly drawn from the dictionary, like elephantine_spatula.jpg * - * @param {Integer} number of filenames to generate - * @param {String} extension, optional, defaults to 'jpg' - * @param {String} directory, optional, defaults to current working directory - * @return {Array} of filenames + * @param $number Integer: of filenames to generate + * @param $extension String: optional, defaults to 'jpg' + * @param $dir String: optional, defaults to current working directory + * @return Array: of filenames */ private function getRandomFilenames( $number, $extension = 'jpg', $dir = null ) { if ( is_null( $dir ) ) { @@ -226,8 +226,8 @@ class RandomImageGenerator { /** * Get an array of random pairs of random words, like array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) ); * - * @param {Integer} number of pairs - * @return {Array} of two-element arrays + * @param $number Integer: number of pairs + * @return Array: of two-element arrays */ private function getRandomWordPairs( $number ) { $lines = $this->getRandomLines( $number * 2 ); @@ -246,9 +246,8 @@ class RandomImageGenerator { * * Will throw exception if the file could not be read or if it had fewer lines than requested. * - * @param {Integer} number of lines desired - * @string {String} path to file - * @return {Array} of exactly n elements, drawn randomly from lines the file + * @param $number_desired Integer: number of lines desired + * @return Array: of exactly n elements, drawn randomly from lines the file */ private function getRandomLines( $number_desired ) { $filepath = $this->dictionaryFile; -- 2.20.1