Garden\Schema::validateFloat PHP Method

validateFloat() protected method

Validate a float.
protected validateFloat ( &$value, array $field, Validation $validation ) : boolean
$field array The field definition.
$validation Validation The validation results to add.
return boolean Returns true if {@link $value} is valid or false otherwise.
    protected function validateFloat(&$value, array $field, Validation $validation)
    {
        if (is_float($value)) {
            $validType = true;
        } elseif (is_numeric($value)) {
            $value = (double) $value;
            $validType = true;
        } else {
            $validType = false;
        }
        return $validType;
    }