/** * {@inheritDoc} */ public function isOptionalZeroPositiveNumber($value, $suppressException = true) { /* Clear the last error. */ $this->lastError = null; /* If valid just return true. */ if (Validator::isOptionalZeroPositiveNumber($value)) { return true; } /* Set the error message. */ $type = gettype($value); $this->lastError = sprintf('Expected null, zero or positive number, \'%s\' given.', 'integer' === $type || 'double' === $type ? 'negative number' : $type); return $this->validationFailed($suppressException); }