Index: trunk/extensions/Validator/includes/Parameter.php |
— | — | @@ -219,21 +219,21 @@ |
220 | 220 | $types = array(); |
221 | 221 | |
222 | 222 | 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] ) ) { |
224 | 224 | $definition['output-types'][$i] = array( $definition['output-types'][$i] ); |
225 | 225 | } |
226 | 226 | |
227 | 227 | $types[$name] = $definition['output-types'][$i]; |
228 | 228 | } |
229 | 229 | |
230 | | - $parameter->outputTypes = $types ; |
| 230 | + $parameter->outputTypes = $types; |
231 | 231 | } |
232 | 232 | elseif ( array_key_exists( 'output-type', $definition ) ) { |
233 | 233 | if ( ! is_array( $definition['output-type'] ) ) { |
234 | 234 | $definition['output-type'] = array( $definition['output-type'] ); |
235 | 235 | } |
236 | 236 | |
237 | | - $parameter->outputTypes = array( $name => $definition['output-type'] ); |
| 237 | + $parameter->outputTypes = array( $definition['output-type'] ); |
238 | 238 | } |
239 | 239 | |
240 | 240 | if ( array_key_exists( 'tolower', $definition ) ) { |
Index: trunk/extensions/Validator/includes/Validator.php |
— | — | @@ -295,14 +295,14 @@ |
296 | 296 | */ |
297 | 297 | public function formatParameters() { |
298 | 298 | 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 ) ) { |
301 | 301 | $parameters = array( &$parameter->value, $parameter->getName(), $this->parameters ); |
302 | 302 | $parameters = array_merge( $parameters, $arguments ); |
303 | | - call_user_func_array( self::$mOutputFormats[$outputType], $parameters ); |
| 303 | + call_user_func_array( self::$mOutputFormats[$outputType[0]], $parameters ); |
304 | 304 | } |
305 | 305 | 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] ); |
307 | 307 | } |
308 | 308 | } |
309 | 309 | } |