r107206 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107205‎ | r107206 | r107207 >
Date:15:52, 24 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Tidy up/add type hints to param documentation
Modified paths:
  • /trunk/extensions/Score/Score.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Score/Score.body.php
@@ -131,7 +131,7 @@
132132 * Creates the specified directory if it does not exist yet.
133133 * Otherwise does nothing.
134134 *
135 - * @param $path path to directory to be created.
 135+ * @param $path string path to directory to be created.
136136 *
137137 * @throws ScoreException if the directory does not exist and could not be created.
138138 */
@@ -212,7 +212,7 @@
213213 * * midi: whether to link to a MIDI file,
214214 * * raw: whether to assume raw LilyPond code.
215215 *
216 - * @return HTML.
 216+ * @return string HTML.
217217 *
218218 * @throws ScoreException if an error occurs.
219219 */
@@ -302,10 +302,10 @@
303303 /**
304304 * Generates score PNG file(s) and possibly a MIDI file.
305305 *
306 - * @param $code score code.
307 - * @param $options rendering options, see Score::generateHTML() for explanation.
308 - * @param $filePrefix prefix for the generated files.
309 - * @param $factoryDirectory directory of the working environment.
 306+ * @param $code string score code.
 307+ * @param $options array rendering options, see Score::generateHTML() for explanation.
 308+ * @param $filePrefix string prefix for the generated files.
 309+ * @param $factoryDirectory string directory of the working environment.
310310 *
311311 * @throws ScoreException on error.
312312 */
@@ -401,10 +401,10 @@
402402 /* trim output images if wanted */
403403 if ( $wgScoreTrim ) {
404404 if ( file_exists( $factoryImage ) ) {
405 - $rc = self::trimImage( $factoryImage, $factoryImageTrimmed );
 405+ self::trimImage( $factoryImage, $factoryImageTrimmed );
406406 }
407407 for ( $i = 1; file_exists( $f = sprintf( $factoryMultiFormat, $i ) ); ++$i ) {
408 - $rc = self::trimImage( $f, sprintf( $factoryMultiTrimmedFormat, $i ) );
 408+ self::trimImage( $f, sprintf( $factoryMultiTrimmedFormat, $i ) );
409409 }
410410 } else {
411411 $factoryImageTrimmed = $factoryImage;
@@ -436,10 +436,10 @@
437437 /**
438438 * Embeds simple LilyPond code in a score block.
439439 *
440 - * @param $lilypondCode simple LilyPond code.
441 - * @param $options rendering options, see Score::generateHTML() for explanation.
 440+ * @param $lilypondCode string simple LilyPond code.
 441+ * @param $options array rendering options, see Score::generateHTML() for explanation.
442442 *
443 - * @return Raw lilypond code.
 443+ * @return string Raw lilypond code.
444444 *
445445 * @throws ScoreException if determining the LilyPond version fails.
446446 */
@@ -471,9 +471,9 @@
472472 /**
473473 * Generates an Ogg/Vorbis file from a MIDI file using timidity.
474474 *
475 - * @param $options rendering options, see Score::generateHTML() for explanation.
476 - * @param $filePrefix prefix for the generated Ogg file.
477 - * @param $factoryDirectory directory of the working environment.
 475+ * @param $options array rendering options, see Score::generateHTML() for explanation.
 476+ * @param $filePrefix string prefix for the generated Ogg file.
 477+ * @param $factoryDirectory string directory of the working environment.
478478 *
479479 * @throws ScoreException if an error occurs.
480480 */
@@ -519,10 +519,10 @@
520520 /**
521521 * Generates LilyPond code.
522522 *
523 - * @param $code score code.
524 - * @param $options rendering options, see Score::generateHTML() for explanation.
525 - * @param $filePrefix prefix for the generated file.
526 - * @param $factoryDirectory directory of the working environment.
 523+ * @param $code string score code.
 524+ * @param $options array rendering options, see Score::generateHTML() for explanation.
 525+ * @param $filePrefix string prefix for the generated file.
 526+ * @param $factoryDirectory string directory of the working environment.
527527 *
528528 * @return the generated LilyPond code.
529529 *
@@ -554,9 +554,11 @@
555555 *
556556 * $code ABC code.
557557 * $factoryDirectory Working environment. As a side-effect, the
558 - * LilyPond input file is created as "file.ly" in this directory.
 558+ * LilyPond input file is created as "file.ly" in this directory.
559559 *
560 - * @return the generated LilyPond code.
 560+ * @param $code string
 561+ * @param $factoryDirectory string
 562+ * @return string the generated LilyPond code.
561563 *
562564 * @throws ScoreException if the conversion fails.
563565 */
@@ -611,8 +613,8 @@
612614 /**
613615 * Trims an image with ImageMagick.
614616 *
615 - * @param $source path to the source image.
616 - * @param $dest path to the target (trimmed) image.
 617+ * @param $source string path to the source image.
 618+ * @param $dest string path to the target (trimmed) image.
617619 *
618620 * @throws ScoreException on error.
619621 */
@@ -633,7 +635,7 @@
634636 /**
635637 * Deletes a directory with no subdirectories with all files in it.
636638 *
637 - * @param $dir path to the directory that is to be deleted.
 639+ * @param $dir string path to the directory that is to be deleted.
638640 *
639641 * @return true on success, false on error
640642 */
@@ -655,7 +657,7 @@
656658 /**
657659 * Writes the specified message to the Score debug log.
658660 *
659 - * @param $msg message to log.
 661+ * @param $msg string message to log.
660662 */
661663 private static function debug( $msg ) {
662664 wfDebugLog( 'Score', $msg );

Status & tagging log