/** * {@inheritDoc} */ public function isOptionalExistingKey($key, array $values, $suppressException = true) { /* Clear the last error. */ $this->lastError = null; /* If valid just return true. */ if (Validator::isOptionalExistingKey($key, $values)) { return true; } /* Set the error message. */ $this->lastError = sprintf('Expected null or array to contain key \'%s\'.', $key); return $this->validationFailed($suppressException); }