r76607 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76606‎ | r76607 | r76608 >
Date:00:32, 13 November 2010
Author:reedy
Status:ok
Tags:
Comment:
Fixed up some doxygen warnings
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php
@@ -68,10 +68,10 @@
6969 /**
7070 * Writes random images with random filenames to disk in the directory you specify, or current working directory
7171 *
72 - * @param {Integer} number of filenames to write
73 - * @param {String} format, optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
74 - * @param {String} directory, optional (will default to current working directory)
75 - * @return {Array} filenames we just wrote
 72+ * @param $number Integer: number of filenames to write
 73+ * @param $format String: optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
 74+ * @param $dir String: directory, optional (will default to current working directory)
 75+ * @return Array: filenames we just wrote
7676 */
7777 function writeImages( $number, $format = 'jpg', $dir = null ) {
7878 $filenames = $this->getRandomFilenames( $number, $format, $dir );
@@ -85,10 +85,10 @@
8686 * Return a number of randomly-generated filenames
8787 * Each filename uses two words randomly drawn from the dictionary, like elephantine_spatula.jpg
8888 *
89 - * @param {Integer} number of filenames to generate
90 - * @param {String} extension, optional, defaults to 'jpg'
91 - * @param {String} directory, optional, defaults to current working directory
92 - * @return {Array} of filenames
 89+ * @param $number Integer: of filenames to generate
 90+ * @param $extension String: optional, defaults to 'jpg'
 91+ * @param $dir String: optional, defaults to current working directory
 92+ * @return Array: of filenames
9393 */
9494 private function getRandomFilenames( $number, $extension = 'jpg', $dir = null ) {
9595 if ( is_null( $dir ) ) {
@@ -226,8 +226,8 @@
227227 /**
228228 * Get an array of random pairs of random words, like array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) );
229229 *
230 - * @param {Integer} number of pairs
231 - * @return {Array} of two-element arrays
 230+ * @param $number Integer: number of pairs
 231+ * @return Array: of two-element arrays
232232 */
233233 private function getRandomWordPairs( $number ) {
234234 $lines = $this->getRandomLines( $number * 2 );
@@ -246,9 +246,8 @@
247247 *
248248 * Will throw exception if the file could not be read or if it had fewer lines than requested.
249249 *
250 - * @param {Integer} number of lines desired
251 - * @string {String} path to file
252 - * @return {Array} of exactly n elements, drawn randomly from lines the file
 250+ * @param $number_desired Integer: number of lines desired
 251+ * @return Array: of exactly n elements, drawn randomly from lines the file
253252 */
254253 private function getRandomLines( $number_desired ) {
255254 $filepath = $this->dictionaryFile;
Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php
@@ -578,7 +578,7 @@
579579
580580 /**
581581 * Helper function -- remove files and associated articles by Title
582 - * @param {Title} title to be removed
 582+ * @param $title Title: title to be removed
583583 */
584584 public function deleteFileByTitle( $title ) {
585585 if ( $title->exists() ) {
@@ -601,7 +601,7 @@
602602
603603 /**
604604 * Helper function -- remove files and associated articles with a particular filename
605 - * @param {String} filename to be removed
 605+ * @param $fileName String: filename to be removed
606606 */
607607 public function deleteFileByFileName( $fileName ) {
608608 return $this->deleteFileByTitle( Title::newFromText( $fileName, NS_FILE ) );
@@ -610,7 +610,7 @@
611611
612612 /**
613613 * Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them.
614 - * @param {String} path to file on the filesystem
 614+ * @param $filePath String: path to file on the filesystem
615615 */
616616 public function deleteFileByContent( $filePath ) {
617617 $hash = File::sha1Base36( $filePath );
@@ -625,10 +625,10 @@
626626 /**
627627 * Fake an upload by dumping the file into temp space, and adding info to $_FILES.
628628 * (This is what PHP would normally do).
629 - * @param {String}: fieldname - name this would have in the upload form
630 - * @param {String}: fileName - name to title this
631 - * @param {String}: mime type
632 - * @param {String}: filePath - path where to find file contents
 629+ * @param $fieldName String: name this would have in the upload form
 630+ * @param $fileName String: name to title this
 631+ * @param $type String: mime type
 632+ * @param $filePath String: path where to find file contents
633633 */
634634 function fakeUploadFile( $fieldName, $fileName, $type, $filePath ) {
635635 $tmpName = tempnam( wfTempDir(), "" );
Index: trunk/phase3/includes/upload/UploadBase.php
@@ -627,8 +627,8 @@
628628 * This method returns the file object, which also has a 'sessionKey' property which can be passed through a form or
629629 * API request to find this stashed file again.
630630 *
631 - * @param {String}: $key (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated.
632 - * @return {File}: stashed file
 631+ * @param $key String: (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated.
 632+ * @return File: stashed file
633633 */
634634 public function stashSessionFile( $key = null ) {
635635 $stash = new UploadStash();
@@ -644,8 +644,8 @@
645645 /**
646646 * Stash a file in a temporary directory, returning a key which can be used to find the file again. See stashSessionFile().
647647 *
648 - * @param {String}: $key (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated.
649 - * @return {String}: session key
 648+ * @param $key String: (optional) the session key used to find the file info again. If not supplied, a key will be autogenerated.
 649+ * @return String: session key
650650 */
651651 public function stashSession( $key = null ) {
652652 return $this->stashSessionFile( $key )->getSessionKey();
@@ -1202,8 +1202,8 @@
12031203 * 'metadata' was requested. Oddly, we have to pass the "result" object down just so it can do that
12041204 * with the appropriate format, presumably.
12051205 *
1206 - * @param {ApiResult}
1207 - * @return {Array} image info
 1206+ * @param $result ApiResult:
 1207+ * @return Array: image info
12081208 */
12091209 public function getImageInfo( $result ) {
12101210 $file = $this->getLocalFile();
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -180,8 +180,8 @@
181181
182182 /**
183183 * From parameters, construct a 'scale' array
184 - * @param {Array} $params
185 - * @return {null|Array} key-val array of 'width' and 'height', or null
 184+ * @param $params Array:
 185+ * @return Array or Null: key-val array of 'width' and 'height', or null
186186 */
187187 public function getScale( $params ) {
188188 $p = $this->getModulePrefix();

Status & tagging log