@@ -6,24 +6,24 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | class HTML_QuickForm_Compare_Fields extends HTML_QuickForm_Rule_Compare |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Function to check an array of fields |
|
| 11 | - * @param array of field names |
|
| 9 | + /** |
|
| 10 | + * Function to check an array of fields |
|
| 11 | + * @param array of field names |
|
| 12 | 12 | * @param string operator ==, >=, etc |
| 13 | 13 | * @param string the value to compare |
| 14 | - * @return boolean True if date is valid |
|
| 15 | - */ |
|
| 16 | - function validate($values = [], $operator_and_max_value = null) { |
|
| 14 | + * @return boolean True if date is valid |
|
| 15 | + */ |
|
| 16 | + function validate($values = [], $operator_and_max_value = null) { |
|
| 17 | 17 | if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) { |
| 18 | - $final_value = 0; |
|
| 19 | - foreach ($values as $value) { |
|
| 20 | - $final_value += $value; |
|
| 21 | - } |
|
| 22 | - $params = explode('@', $operator_and_max_value); |
|
| 23 | - $operator = $params[0]; |
|
| 24 | - $max_value = $params[1]; |
|
| 25 | - return parent::validate(array($final_value, $max_value), $operator); |
|
| 18 | + $final_value = 0; |
|
| 19 | + foreach ($values as $value) { |
|
| 20 | + $final_value += $value; |
|
| 21 | + } |
|
| 22 | + $params = explode('@', $operator_and_max_value); |
|
| 23 | + $operator = $params[0]; |
|
| 24 | + $max_value = $params[1]; |
|
| 25 | + return parent::validate(array($final_value, $max_value), $operator); |
|
| 26 | 26 | } |
| 27 | 27 | return false; |
| 28 | - } |
|
| 28 | + } |
|
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |