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