r70310 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70309‎ | r70310 | r70311 >
Date:02:35, 2 August 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added docs and log error level
Modified paths:
  • /trunk/extensions/Validator/Validator.php (modified) (history)
  • /trunk/extensions/Validator/Validator_Manager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/Validator_Manager.php
@@ -25,10 +25,13 @@
2626 */
2727 final class ValidatorManager {
2828
 29+ /**
 30+ * @var Validator
 31+ */
2932 private $validator;
3033
3134 /**
32 - * Validates the provided parameters, and corrects them depending on the error level.
 35+ * Parses and validates the provided parameters, and corrects them depending on the error level.
3336 *
3437 * @param array $rawParameters The raw parameters, as provided by the user.
3538 * @param array $parameterInfo Array containing the parameter definitions, which are needed for validation and defaulting.
@@ -51,6 +54,14 @@
5255 return !$this->validator->hasFatalError();
5356 }
5457
 58+ /**
 59+ * Validates the provided parameters, and corrects them depending on the error level.
 60+ *
 61+ * @since 3.x
 62+ *
 63+ * @param $parameters Array
 64+ * @param $parameterInfo Array
 65+ */
5566 public function manageParsedParameters( array $parameters, array $parameterInfo ) {
5667 global $egValidatorErrorLevel;
5768
@@ -69,6 +80,8 @@
7081 /**
7182 * Returns an array with the valid parameters.
7283 *
 84+ * @since 3.x
 85+ *
7386 * @param boolean $includeMetaData
7487 *
7588 * @return array
@@ -173,4 +186,5 @@
174187 return '';
175188 }
176189 }
 190+
177191 }
\ No newline at end of file
Index: trunk/extensions/Validator/Validator.php
@@ -28,6 +28,7 @@
2929
3030 // Constants indicating the strictness of the parameter validation.
3131 define( 'Validator_ERRORS_NONE', 0 );
 32+define( 'Validator_ERRORS_LOG', 1 );
3233 define( 'Validator_ERRORS_WARN', 2 );
3334 define( 'Validator_ERRORS_SHOW', 3 );
3435 define( 'Validator_ERRORS_STRICT', 4 );

Status & tagging log