r72498 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72497‎ | r72498 | r72499 >
Date:16:35, 6 September 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r72497
Modified paths:
  • /trunk/extensions/Validator/includes/Parameter.php (modified) (history)
  • /trunk/extensions/Validator/includes/Validator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/Parameter.php
@@ -219,21 +219,21 @@
220220 $types = array();
221221
222222 for ( $i = 0, $c = count( $definition['output-types'] ); $i < $c; $i++ ) {
223 - if ( ! is_array( $definition['output-types'][$i] ) ) {
 223+ if ( !is_array( $definition['output-types'][$i] ) ) {
224224 $definition['output-types'][$i] = array( $definition['output-types'][$i] );
225225 }
226226
227227 $types[$name] = $definition['output-types'][$i];
228228 }
229229
230 - $parameter->outputTypes = $types ;
 230+ $parameter->outputTypes = $types;
231231 }
232232 elseif ( array_key_exists( 'output-type', $definition ) ) {
233233 if ( ! is_array( $definition['output-type'] ) ) {
234234 $definition['output-type'] = array( $definition['output-type'] );
235235 }
236236
237 - $parameter->outputTypes = array( $name => $definition['output-type'] );
 237+ $parameter->outputTypes = array( $definition['output-type'] );
238238 }
239239
240240 if ( array_key_exists( 'tolower', $definition ) ) {
Index: trunk/extensions/Validator/includes/Validator.php
@@ -295,14 +295,14 @@
296296 */
297297 public function formatParameters() {
298298 foreach ( $this->parameters as $parameter ) {
299 - foreach ( $parameter->outputTypes as $outputType => $arguments ) {
300 - if ( array_key_exists( $outputType, self::$mOutputFormats ) ) {
 299+ foreach ( $parameter->outputTypes as $outputType ) {
 300+ if ( array_key_exists( $outputType[0], self::$mOutputFormats ) ) {
301301 $parameters = array( &$parameter->value, $parameter->getName(), $this->parameters );
302302 $parameters = array_merge( $parameters, $arguments );
303 - call_user_func_array( self::$mOutputFormats[$outputType], $parameters );
 303+ call_user_func_array( self::$mOutputFormats[$outputType[0]], $parameters );
304304 }
305305 else {
306 - throw new Exception( 'There is no formatting function for output format ' . $outputType );
 306+ throw new Exception( 'There is no formatting function for output format ' . $outputType[0] );
307307 }
308308 }
309309 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72497Changes for 0.7 - matching changes made in Validatorjeroendedauw16:17, 6 September 2010

Status & tagging log