Gregwar\RST\Parser::prepareCode PHP Method

prepareCode() protected method

Tells if the current buffer is announcing a block of code
protected prepareCode ( ) : boolean
return boolean
    protected function prepareCode()
    {
        if (!$this->buffer) {
            return false;
        }
        $lastLine = trim($this->buffer[count($this->buffer) - 1]);
        if (strlen($lastLine) >= 2) {
            if (substr($lastLine, -2) == '::') {
                if (trim($lastLine) == '::') {
                    array_pop($this->buffer);
                } else {
                    $this->buffer[count($this->buffer) - 1] = substr($lastLine, 0, -1);
                }
                return true;
            }
        }
        return false;
    }