private function updateMessage()
    {
        $this->message = $this->rawMessage;

        $dot = false;
        if ('.' === substr($this->message, -1)) {
            $this->message = substr($this->message, 0, -1);
            $dot = true;
        }

        if (null !== $this->document) {
            $this->message .= sprintf(' in %s', $this->document);
        }

        if ($this->snippet) {
            $this->message .= sprintf(' (near %s)', $this->snippet);
        }

        if ($dot) {
            $this->message .= '.';
        }
    }