| @@ -14,13 +14,8 @@ | ||
| 14 | 14 | */ |
| 15 | 15 | protected $type = 'number'; |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * @var string | |
| 19 | - */ | |
| 20 | - protected $display_type = 'text'; | |
| 21 | - | |
| 22 | - /** | |
| 23 | 18 | * @var bool |
| 24 | 19 | */ |
| 25 | 20 | protected $array_allowed = false; |
| 26 | 21 | |
| @@ -67,9 +62,9 @@ | ||
| 67 | 62 | $errors = array(); |
| 68 | 63 | |
| 69 | 64 | $this->remove_commas_from_number( $args ); |
| 70 | 65 | |
| 71 | - //validate the number format | |
| 66 | + // Validate the number format. | |
| 72 | 67 | if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) { |
| 73 | 68 | $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
| 74 | 69 | } |
| 75 | 70 | |
| @@ -105,9 +100,10 @@ | ||
| 105 | 100 | * @return void |
| 106 | 101 | */ |
| 107 | 102 | private function validate_step( &$errors, $args ) { |
| 108 | 103 | if ( isset( $errors[ 'field' . $args['id'] ] ) ) { |
| 109 | - return; // Don't need to check if value is invalid before. | |
| 104 | + // Don't need to check if value is invalid before. | |
| 105 | + return; | |
| 110 | 106 | } |
| 111 | 107 | |
| 112 | 108 | $step = FrmField::get_option( $this->field, 'step' ); |
| 113 | 109 | if ( ! $step || ! is_numeric( $step ) ) { |
| @@ -133,9 +129,9 @@ | ||
| 133 | 129 | * @since 5.2.07 |
| 134 | 130 | * |
| 135 | 131 | * @param numeric $value The value. |
| 136 | 132 | * @param numeric $step The step. |
| 137 | - * @return int|array Return `0` if valid. Otherwise, return an array contains two nearest values. | |
| 133 | + * @return array|int Return `0` if valid. Otherwise, return an array contains two nearest values. | |
| 138 | 134 | */ |
| 139 | 135 | private function check_value_is_valid_with_step( $value, $step ) { |
| 140 | 136 | // Count the number of decimals. |
| 141 | 137 | $decimals = max( FrmAppHelper::count_decimals( $value ), FrmAppHelper::count_decimals( $step ) ); |