Index: trunk/extensions/Validator/includes/parserHooks/Validator_ListErrors.php |
— | — | @@ -66,19 +66,18 @@ |
67 | 67 | * |
68 | 68 | * @since 0.4 |
69 | 69 | * |
70 | | - * @return array |
| 70 | + * @return array of Parameter |
71 | 71 | */ |
72 | 72 | protected function getParameterInfo( $type ) { |
73 | 73 | global $egValidatorErrListMin; |
74 | 74 | |
75 | | - return array( |
76 | | - 'minseverity' => array( |
77 | | - 'criteria' => array( |
78 | | - 'in_array' => array_keys( self::$severityMap ) |
79 | | - ), |
80 | | - 'default' => $egValidatorErrListMin |
81 | | - ) |
82 | | - ); |
| 75 | + $params = array(); |
| 76 | + |
| 77 | + $params['minseverity'] = new Parameter( 'minseverity' ); |
| 78 | + $params['minseverity']->setDefault( $egValidatorErrListMin ); |
| 79 | + $params['minseverity']->addCriteria( new CriterionInArray( array_keys( self::$severityMap ) ) ); |
| 80 | + |
| 81 | + return $params; |
83 | 82 | } |
84 | 83 | |
85 | 84 | /** |
Index: trunk/extensions/Validator/includes/Validator.php |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | $cleanedList[$parameter->getName()] = $parameter; |
211 | 211 | } |
212 | 212 | else { |
213 | | - $cleanedList[$key] = Parameter::newFromArray( $key, $parameter ); |
| 213 | + throw new Exception( "$key is not a valid Parameter." ); |
214 | 214 | } |
215 | 215 | } |
216 | 216 | |