Gregwar\RST\Parser::isSpecialLine PHP Method

isSpecialLine() protected method

Tell if a line is a special separating line for title and separators, returns the depth of the special line
protected isSpecialLine ( string $line ) : boolean
$line string
return boolean
    protected function isSpecialLine($line)
    {
        if (strlen($line) < 3) {
            return false;
        }
        $letter = $line[0];
        $environment = $this->environment;
        if (!in_array($letter, $environment::$letters)) {
            return false;
        }
        for ($i = 1; $i < strlen($line); $i++) {
            if ($line[$i] != $letter) {
                return false;
            }
        }
        return $letter;
    }