r87615 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87614‎ | r87615 | r87616 >
Date:00:26, 7 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
up rel notes, fix typos, up licence
Modified paths:
  • /trunk/extensions/Validator/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/Validator/Validator.i18n.php (modified) (history)
  • /trunk/extensions/Validator/Validator.php (modified) (history)
  • /trunk/extensions/Validator/Validator_Settings.php (modified) (history)
  • /trunk/extensions/Validator/includes/CriterionValidationResult.php (modified) (history)
  • /trunk/extensions/Validator/includes/ItemParameterCriterion.php (modified) (history)
  • /trunk/extensions/Validator/includes/ItemParameterManipulation.php (modified) (history)
  • /trunk/extensions/Validator/includes/ListParameter.php (modified) (history)
  • /trunk/extensions/Validator/includes/ListParameterCriterion.php (modified) (history)
  • /trunk/extensions/Validator/includes/ListParameterManipulation.php (modified) (history)
  • /trunk/extensions/Validator/includes/Parameter.php (modified) (history)
  • /trunk/extensions/Validator/includes/ParameterCriterion.php (modified) (history)
  • /trunk/extensions/Validator/includes/ParameterInput.php (modified) (history)
  • /trunk/extensions/Validator/includes/ParameterManipulation.php (modified) (history)
  • /trunk/extensions/Validator/includes/ParserHook.php (modified) (history)
  • /trunk/extensions/Validator/includes/ValidationError.php (modified) (history)
  • /trunk/extensions/Validator/includes/ValidationErrorHandler.php (modified) (history)
  • /trunk/extensions/Validator/includes/Validator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/RELEASE-NOTES
@@ -4,6 +4,18 @@
55 This change log contains a list of completed to-do's (new features, bug fixes, refactoring) for every version of Validator.
66
77
 8+=== Validator 0.4.6 ===
 9+(2011-05-xx)
 10+
 11+* Added ParameterInput class to generate HTML inputs for parameters, based on code from SMWs Special:Ask.
 12+
 13+* Removed ParamManipulationBoolstr
 14+
 15+* Added "$manipulate = true" as second parameter for Parameter::setDefault,
 16+ which gets passed to Parameter::setDoManipulationOfDefault.
 17+
 18+* Boolean manipulation now ignores values that are already a boolean.
 19+
820 === Validator 0.4.5 ===
921 (2011-03-05)
1022
Index: trunk/extensions/Validator/includes/ListParameterCriterion.php
@@ -13,7 +13,8 @@
1414 * @ingroup Validator
1515 * @ingroup Criteria
1616 *
17 - * @author Jeroen De Dauw
 17+ * @licence GNU GPL v3 or later
 18+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1819 */
1920 abstract class ListParameterCriterion extends ParameterCriterion {
2021
Index: trunk/extensions/Validator/includes/ListParameterManipulation.php
@@ -11,7 +11,8 @@
1212 * @ingroup Validator
1313 * @ingroup ParameterManipulations
1414 *
15 - * @author Jeroen De Dauw
 15+ * @licence GNU GPL v3 or later
 16+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1617 */
1718 abstract class ListParameterManipulation extends ParameterManipulation {
1819
Index: trunk/extensions/Validator/includes/ParameterCriterion.php
@@ -9,7 +9,8 @@
1010 * @ingroup Validator
1111 * @ingroup Criteria
1212 *
13 - * @author Jeroen De Dauw
 13+ * @licence GNU GPL v3 or later
 14+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1415 */
1516 abstract class ParameterCriterion {
1617
Index: trunk/extensions/Validator/includes/ParameterInput.php
@@ -15,7 +15,7 @@
1616 * @ingroup Validator
1717 *
1818 * @licence GNU GPL v3 or later
19 - * @author Jeroen De Dauw
 19+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
2020 */
2121 class ParameterInput {
2222
Index: trunk/extensions/Validator/includes/ParameterManipulation.php
@@ -9,7 +9,8 @@
1010 * @ingroup Validator
1111 * @ingroup ParameterManipulations
1212 *
13 - * @author Jeroen De Dauw
 13+ * @licence GNU GPL v3 or later
 14+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1415 */
1516 abstract class ParameterManipulation {
1617
Index: trunk/extensions/Validator/includes/ValidationErrorHandler.php
@@ -8,7 +8,8 @@
99 * @file Validator_ErrorHandler.php
1010 * @ingroup Validator
1111 *
12 - * @author Jeroen De Dauw
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 final class ValidationErrorHandler {
1516
Index: trunk/extensions/Validator/includes/ValidationError.php
@@ -8,7 +8,8 @@
99 * @file Validator_Error.php
1010 * @ingroup Validator
1111 *
12 - * @author Jeroen De Dauw
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class ValidationError {
1516
Index: trunk/extensions/Validator/includes/CriterionValidationResult.php
@@ -8,7 +8,8 @@
99 * @file CriterionValidationResult.php
1010 * @ingroup Validator
1111 *
12 - * @author Jeroen De Dauw
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class CriterionValidationResult {
1516
@@ -80,7 +81,7 @@
8182 }
8283
8384 /**
84 - * Returns whether no errors occured.
 85+ * Returns whether no errors occurred.
8586 *
8687 * @since 0.4
8788 *
Index: trunk/extensions/Validator/includes/ListParameter.php
@@ -8,7 +8,8 @@
99 * @file ListParameter.php
1010 * @ingroup Validator
1111 *
12 - * @author Jeroen De Dauw
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class ListParameter extends Parameter {
1516
Index: trunk/extensions/Validator/includes/ParserHook.php
@@ -9,7 +9,8 @@
1010 * @file ParserHook.php
1111 * @ingroup Validator
1212 *
13 - * @author Jeroen De Dauw
 13+ * @licence GNU GPL v3 or later
 14+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1415 */
1516 abstract class ParserHook {
1617
Index: trunk/extensions/Validator/includes/ItemParameterCriterion.php
@@ -2,7 +2,7 @@
33
44 /**
55 * Item parameter criterion definition class. This is for criteria
6 - * that apply to indivudial values, which can either be the whole value
 6+ * that apply to individual values, which can either be the whole value
77 * of a non-list parameter, or a single item of a list parameter.
88 *
99 * @since 0.4
@@ -11,7 +11,8 @@
1212 * @ingroup Validator
1313 * @ingroup Criteria
1414 *
15 - * @author Jeroen De Dauw
 15+ * @licence GNU GPL v3 or later
 16+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1617 */
1718 abstract class ItemParameterCriterion extends ParameterCriterion {
1819
Index: trunk/extensions/Validator/includes/ItemParameterManipulation.php
@@ -11,7 +11,8 @@
1212 * @ingroup Validator
1313 * @ingroup ParameterManipulations
1414 *
15 - * @author Jeroen De Dauw
 15+ * @licence GNU GPL v3 or later
 16+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1617 */
1718 abstract class ItemParameterManipulation extends ParameterManipulation {
1819
Index: trunk/extensions/Validator/includes/Parameter.php
@@ -8,7 +8,8 @@
99 * @file Parameter.php
1010 * @ingroup Validator
1111 *
12 - * @author Jeroen De Dauw
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class Parameter {
1516
Index: trunk/extensions/Validator/includes/Validator.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * Class for parameter validation of a single parser hook or other parameterized construct.
 5+ * Class for parameter validation of a single parser hook or other parametrized construct.
66 *
77 * @since 0.1
88 *
@@ -9,7 +9,6 @@
1010 * @ingroup Validator
1111 *
1212 * @licence GNU GPL v3 or later
13 - *
1413 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1514 */
1615 class Validator {
@@ -409,6 +408,8 @@
410409 /**
411410 * Returns the errors.
412411 *
 412+ * @since 0.4
 413+ *
413414 * @return array of ValidationError
414415 */
415416 public function getErrors() {
@@ -416,6 +417,21 @@
417418 }
418419
419420 /**
 421+ * @since 0.4.6
 422+ *
 423+ * @return array of string
 424+ */
 425+ public function getErrorMessages() {
 426+ $errors = array();
 427+
 428+ foreach ( $this->errors as $error ) {
 429+ $errors[] = $error->getMessage();
 430+ }
 431+
 432+ return $errors;
 433+ }
 434+
 435+ /**
420436 * Returns if there where any errors during validation.
421437 *
422438 * @return boolean
@@ -439,4 +455,4 @@
440456 return false;
441457 }
442458
443 -}
\ No newline at end of file
 459+}
Index: trunk/extensions/Validator/Validator.i18n.php
@@ -6,7 +6,8 @@
77 * @file Validator.i18n.php
88 * @ingroup Validator
99 *
10 - * @author Jeroen De Dauw
 10+ * @licence GNU GPL v3 or later
 11+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1112 */
1213
1314 $messages = array();
Index: trunk/extensions/Validator/Validator.php
@@ -10,7 +10,6 @@
1111 * @ingroup Validator
1212 *
1313 * @licence GNU GPL v3 or later
14 - *
1514 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1615 */
1716
Index: trunk/extensions/Validator/Validator_Settings.php
@@ -4,13 +4,14 @@
55 * File defining the settings for the Validator extension
66 *
77 * NOTICE:
8 - * Changing one of these settings can be done by copieng or cutting it,
 8+ * Changing one of these settings can be done by copying or cutting it,
99 * and placing it in LocalSettings.php, AFTER the inclusion of Validator.
1010 *
1111 * @file Validator_Settings.php
1212 * @ingroup Validator
1313 *
14 - * @author Jeroen De Dauw
 14+ * @licence GNU GPL v3 or later
 15+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1516 */
1617
1718 if ( !defined( 'MEDIAWIKI' ) ) {

Status & tagging log