Garden\Schema::validateInteger PHP Method

validateInteger() protected method

Validate and integer.
protected validateInteger ( &$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 validateInteger(&$value, array $field, Validation $validation)
    {
        if (is_int($value)) {
            $validType = true;
        } elseif (is_numeric($value)) {
            $value = (int) $value;
            $validType = true;
        } else {
            $validType = false;
        }
        return $validType;
    }