r110625 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110624‎ | r110625 | r110626 >
Date:22:27, 2 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Fix some mixed tabs and spaces

Simplify a couple of returns
Modified paths:
  • /trunk/extensions/OggHandler/OggHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggHandler_body.php
@@ -20,11 +20,8 @@
2121
2222 function validateParam( $name, $value ) {
2323 if ( in_array( $name, array( 'width', 'height' ) ) ) {
24 - if ( $value <= 0 ) {
25 - return false;
26 - }
27 - return true;
28 - }
 24+ return $value > 0;
 25+ }
2926 if ( $name == 'thumbtime' ) {
3027 $time = $this->parseTimeString( $value );
3128 if ( $time === false || $time <= 0 ) {
@@ -32,10 +29,7 @@
3330 }
3431 return true;
3532 }
36 - if ( $name == 'noicon' ) {
37 - return true;
38 - }
39 - return false;
 33+ return $name == 'noicon';
4034 }
4135
4236 function parseTimeString( $seekString, $length = false ) {
@@ -211,9 +205,9 @@
212206 }
213207
214208 function doTransform( $file, $dstPath, $dstUrl, $params, $flags = 0 ) {
215 - if ( !$this->normaliseParams( $file, $params ) ) {
216 - return new TransformParameterError( $params );
217 - }
 209+ if ( !$this->normaliseParams( $file, $params ) ) {
 210+ return new TransformParameterError( $params );
 211+ }
218212
219213 $width = $params['width'];
220214 $height = $params['height'];
@@ -254,7 +248,6 @@
255249 return new OggVideoDisplay( $file, $targetFileUrl, $dstUrl, $width, $height, $length, $dstPath, $noIcon );
256250 }
257251
258 -
259252 $thumbTime = false;
260253 if ( isset( $params['thumbtime'] ) ) {
261254 $thumbTime = $this->parseTimeString( $params['thumbtime'], $length );
@@ -430,7 +423,7 @@
431424 $wgLang->formatBitrate( $bitrate ),
432425 $wgLang->formatNum( $file->getWidth() ),
433426 $wgLang->formatNum( $file->getHeight() )
434 - );
 427+ );
435428 }
436429
437430 function getDimensionsString( $file ) {

Status & tagging log