/** * {@inheritDoc} */ public function isOptionalFloatRange($value, $min, $max, $suppressException = true) { /* Clear the last error. */ $this->lastError = null; /* If valid just return true. */ if (Validator::isOptionalFloatRange($value, $min, $max)) { return true; } /* Set the error message. */ $this->lastError = sprintf('Expects null or float in range [%d, %d], \'%d\' given.', $min, $max, is_scalar($value) ? $value : gettype($value)); return $this->validationFailed($suppressException); }