r65781 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65780‎ | r65781 | r65782 >
Date:04:34, 2 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r65670
Modified paths:
  • /trunk/extensions/Validator/Validator.class.php (modified) (history)
  • /trunk/extensions/Validator/Validator_Functions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/Validator.class.php
@@ -69,8 +69,8 @@
7070 private static $mValidationFunctions = array(
7171 'in_array' => array( 'ValidatorFunctions', 'in_array' ),
7272 'in_range' => array( 'ValidatorFunctions', 'in_range' ),
73 - 'is_numeric' => 'is_numeric',
74 - 'is_float' => 'is_float',
 73+ 'is_numeric' => array( 'ValidatorFunctions', 'is_numeric' ),
 74+ 'is_float' => array( 'ValidatorFunctions', 'is_float' ),
7575 'is_integer' => array( 'ValidatorFunctions', 'is_integer' ),
7676 'not_empty' => array( 'ValidatorFunctions', 'not_empty' ),
7777 'has_length' => array( 'ValidatorFunctions', 'has_length' ),
Index: trunk/extensions/Validator/Validator_Functions.php
@@ -26,8 +26,9 @@
2727 * Returns whether the provided value, which must be a number, is within a certain range. Upper bound included.
2828 *
2929 * @param $value
30 - * @param $lower
31 - * @param $upper
 30+ * @param array $metaData
 31+ * @param mixed $lower
 32+ * @param mixed $upper
3233 *
3334 * @return boolean
3435 */
@@ -43,6 +44,7 @@
4445 * Returns whether the string value is not empty. Not empty is defined as having at least one character after trimming.
4546 *
4647 * @param $value
 48+ * @param array $metaData
4749 *
4850 * @return boolean
4951 */
@@ -54,6 +56,7 @@
5557 * Returns whether the string value is not empty. Not empty is defined as having at least one character after trimming.
5658 *
5759 * @param $value
 60+ * @param array $metaData
5861 *
5962 * @return boolean
6063 */
@@ -68,6 +71,7 @@
6972 * Returns whether a variable is an integer or an integer string. Uses the native PHP function.
7073 *
7174 * @param $value
 75+ * @param array $metaData
7276 *
7377 * @return boolean
7478 */
@@ -79,8 +83,9 @@
8084 * Returns whether the length of the value is within a certain range. Upper bound included.
8185 *
8286 * @param string $value
83 - * @param $lower
84 - * @param $upper
 87+ * @param array $metaData
 88+ * @param mixed $lower
 89+ * @param mixed $upper
8590 *
8691 * @return boolean
8792 */
@@ -92,8 +97,9 @@
9398 * Returns whether the amount of items in the list is within a certain range. Upper bound included.
9499 *
95100 * @param array $values
96 - * @param $lower
97 - * @param $upper
 101+ * @param array $metaData
 102+ * @param mixed $lower
 103+ * @param mixed $upper
98104 *
99105 * @return boolean
100106 */
@@ -105,6 +111,7 @@
106112 * Returns whether the list of values does not have any duplicates.
107113 *
108114 * @param array $values
 115+ * @param array $metaData
109116 *
110117 * @return boolean
111118 */
@@ -116,6 +123,7 @@
117124 * Returns the result of preg_match.
118125 *
119126 * @param string $value
 127+ * @param array $metaData
120128 * @param string $pattern
121129 *
122130 * @return boolean
@@ -123,4 +131,28 @@
124132 public static function regex( $value, array $metaData, $pattern ) {
125133 return (bool)preg_match( $pattern, $value );
126134 }
 135+
 136+ /**
 137+ * Wrapper for the native is_numeric function.
 138+ *
 139+ * @param $value
 140+ * @param array $metaData
 141+ *
 142+ * @return boolean
 143+ */
 144+ public static function is_numeric( $value, array $metaData ) {
 145+ return is_numeric( $value );
 146+ }
 147+
 148+ /**
 149+ * Wrapper for the native is_float function.
 150+ *
 151+ * @param $value
 152+ * @param array $metaData
 153+ *
 154+ * @return boolean
 155+ */
 156+ public static function is_float( $value, array $metaData ) {
 157+ return is_float( $value );
 158+ }
127159 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65670CHanges for 0.3 - Partially added dependency handling and support for by meta...jeroendedauw21:32, 29 April 2010

Status & tagging log