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; }