Index: trunk/extensions/Validator/includes/manipulations/ParamManipulationInteger.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * |
29 | 29 | * @since 0.4 |
30 | 30 | */ |
31 | | - public function doManipulation( &$value, array &$parameters ) { |
| 31 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
32 | 32 | $value = (int)$value; |
33 | 33 | } |
34 | 34 | |
Index: trunk/extensions/Validator/includes/manipulations/ParamManipulationBoolean.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * |
29 | 29 | * @since 0.4 |
30 | 30 | */ |
31 | | - public function doManipulation( &$value, array &$parameters ) { |
| 31 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
32 | 32 | $value = in_array( $value, array( 'yes', 'on' ) ); |
33 | 33 | } |
34 | 34 | |
Index: trunk/extensions/Validator/includes/manipulations/ParamManipulationBoolstr.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * |
29 | 29 | * @since 0.4 |
30 | 30 | */ |
31 | | - public function doManipulation( &$value, array &$parameters ) { |
| 31 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
32 | 32 | $value = $value ? 'true' : 'false'; |
33 | 33 | } |
34 | 34 | |
Index: trunk/extensions/Validator/includes/manipulations/ParamManipulationFloat.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * |
29 | 29 | * @since 0.4 |
30 | 30 | */ |
31 | | - public function doManipulation( &$value, array &$parameters ) { |
| 31 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
32 | 32 | $value = (float)$value; |
33 | 33 | } |
34 | 34 | |
Index: trunk/extensions/Validator/includes/ItemParameterManipulation.php |
— | — | @@ -19,13 +19,14 @@ |
20 | 20 | * Manipulate an actual value. |
21 | 21 | * |
22 | 22 | * @param string $value |
| 23 | + * @param Parameter $parameter |
23 | 24 | * @param array $parameters |
24 | 25 | * |
25 | 26 | * @since 0.4 |
26 | 27 | * |
27 | 28 | * @return mixed |
28 | 29 | */ |
29 | | - protected abstract function doManipulation( &$value, array &$parameters ); |
| 30 | + protected abstract function doManipulation( &$value, Parameter $parameter, array &$parameters ); |
30 | 31 | |
31 | 32 | /** |
32 | 33 | * Constructor. |
— | — | @@ -42,6 +43,7 @@ |
43 | 44 | public function isForLists() { |
44 | 45 | return false; |
45 | 46 | } |
| 47 | + |
46 | 48 | /** |
47 | 49 | * Validate a parameter against the criterion. |
48 | 50 | * |
— | — | @@ -54,12 +56,12 @@ |
55 | 57 | if ( is_array( $parameter->getValue() ) ) { |
56 | 58 | $value = &$parameter->getValue(); |
57 | 59 | foreach ( $value as &$item ) { |
58 | | - $this->doManipulation( $item, $parameters ); |
| 60 | + $this->doManipulation( $item, $parameter, $parameters ); |
59 | 61 | } |
60 | 62 | } |
61 | 63 | else { |
62 | | - $this->doManipulation( $parameter->getValue(), $parameters ); |
| 64 | + $this->doManipulation( $parameter->getValue(), $parameter, $parameters ); |
63 | 65 | } |
64 | | - } |
| 66 | + } |
65 | 67 | |
66 | 68 | } |
\ No newline at end of file |
Index: trunk/extensions/Validator/includes/Validator.php |
— | — | @@ -302,7 +302,7 @@ |
303 | 303 | $dependencies = array(); |
304 | 304 | |
305 | 305 | foreach ( $this->paramsTohandle as $paramName ) { |
306 | | - $dependencies[$paramName] = array();//$this->parameters[$paramName]->getDependencies(); |
| 306 | + $dependencies[$paramName] = array(); //$this->parameters[$paramName]->getDependencies(); |
307 | 307 | } |
308 | 308 | |
309 | 309 | $sorter = new TopologicalSort( $dependencies, true ); |
Index: trunk/extensions/Validator/Validator.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | die( 'Not an entry point.' ); |
26 | 26 | } |
27 | 27 | |
28 | | -define( 'Validator_VERSION', '0.4 alpha-6' ); |
| 28 | +define( 'Validator_VERSION', '0.4 alpha-7' ); |
29 | 29 | |
30 | 30 | // Register the internationalization file. |
31 | 31 | $wgExtensionMessagesFiles['Validator'] = dirname( __FILE__ ) . '/Validator.i18n.php'; |