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