public function getLineStart()

in src/Fixers/ClientUpgradeFixer/ClientVar.php [97:112]


    public function getLineStart(Tokens $tokens): int
    {
        // determine the indent
        $indent = '';
        $lineStart = $this->startIndex;
        $i = 1;
        while (
            $this->startIndex - $i >= 0
            && false === strpos($tokens[$this->startIndex - $i]->getContent(), "\n")
            && $tokens[$this->startIndex - $i]->getId() !== T_OPEN_TAG
        ) {
            $i++;
        }

        return $this->startIndex - $i;
    }