Xpressengine\Document\Models\Document::makeReplyChar PHP Method

makeReplyChar() protected method

Make next reply code characters
protected makeReplyChar ( string $prevChars = null ) : string
$prevChars string previous child reply code character
return string
    protected function makeReplyChar($prevChars = null)
    {
        $std = '0123456789abcdefghijklmnopqrstuvwxyz';
        $std = str_split($std, 1);
        if ($prevChars === null) {
            return str_repeat($std[0], self::getReplyCharLen());
        }
        if ($prevChars[strlen($prevChars) - 1] == end($std)) {
            if (strlen($prevChars) < 2) {
                throw new ReplyLimitationException();
            }
            reset($std);
            $new = $this->makeReplyChar(substr($prevChars, 0, strlen($prevChars) - 1)) . current($std);
        } else {
            $key = array_search($prevChars[strlen($prevChars) - 1], $std);
            $new = substr($prevChars, 0, strlen($prevChars) - 1) . $std[$key + 1];
        }
        return $new;
    }