protected function normalizeNumericValue($value) { if (empty($value)) { return 0; } if (is_string($value) && is_numeric($value)) { $value = (double) $value; } if (!is_numeric($value)) { throw new InvalidParamException("'{$value}' is not a numeric value."); } return $value; }