src/Schema.php
protected function validateNumber($value, ValidationField $field) {
        $result = filter_var($value, FILTER_VALIDATE_FLOAT);
        if ($result === false) {
            $field->addTypeError($value, 'number');
            return Invalid::value();
        }

        $result = $this->validateNumberProperties($result, $field);

        return $result;
    }
protected function validateNumber($value, ValidationField $field) {
        $result = filter_var($value, FILTER_VALIDATE_FLOAT);
        if ($result === false) {
            $field->addTypeError($value, 'number');
            return Invalid::value();
        }

        $result = $this->validateNumberProperties($result, $field);

        return $result;
    }
protected function validateNumber ( $ value , ValidationField $ field ) { $ result = filter_var ( $ value , FILTER_VALIDATE_FLOAT ) ; if ( $ result === false ) { $ field -> addTypeError ( $ value , 'number' ) ; return Invalid :: value ( ) ; } $ result = $ this -> validateNumberProperties ( $ result , $ field ) ; return $ result ; }
Validate a float.

@param mixed $value The value to validate.
@param ValidationField $field The validation results to add.
@return float|Invalid Returns a number or **null** if validation fails.
Validate a float .