src/Blocks/Lists/Tree/Builder.php
protected function getLevelByContent($lineContent)
    {
        $levelDelimiter = str_repeat(static::SPACE_CHARACTER, static::SPACES_AS_TAB);
        $lineContent = str_replace(static::TAB_CHARACTER, $levelDelimiter, $lineContent);

        $length = $this->getLength($lineContent);
        $foundLevel = substr_count($lineContent, $levelDelimiter, 0, $length);

        return $foundLevel;
    }
protected function getLevelByContent($lineContent)
    {
        $levelDelimiter = str_repeat(static::SPACE_CHARACTER, static::SPACES_AS_TAB);
        $lineContent = str_replace(static::TAB_CHARACTER, $levelDelimiter, $lineContent);

        $length = $this->getLength($lineContent);
        $foundLevel = substr_count($lineContent, $levelDelimiter, 0, $length);

        return $foundLevel;
    }
@param string $lineContent

@return int