src/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixer.php
private function getIndentAt(Tokens $tokens, $index)
    {
        $content = '';
        $lineEnding = $this->whitespacesConfig->getLineEnding();

        // find line ending token
        for ($index; $index > 0; --$index) {
            if (false !== strstr($tokens[$index]->getContent(), $lineEnding)) {
                break;
            }
        }

        if ($tokens[$index]->isWhitespace()) {
            $content = $tokens[$index]->getContent();
            --$index;
        }

        if ($tokens[$index]->isGivenKind(T_OPEN_TAG)) {
            $content = $tokens[$index]->getContent().$content;
        }

        if (1 === Preg::match('/\R{1}([ \t]*)$/', $content, $matches)) {
            return $matches[1];
        }

        return null;
    }
private function getIndentAt(Tokens $tokens, $index)
    {
        $content = '';
        $lineEnding = $this->whitespacesConfig->getLineEnding();

        // find line ending token
        for ($index; $index > 0; --$index) {
            if (false !== strstr($tokens[$index]->getContent(), $lineEnding)) {
                break;
            }
        }

        if ($tokens[$index]->isWhitespace()) {
            $content = $tokens[$index]->getContent();
            --$index;
        }

        if ($tokens[$index]->isGivenKind(T_OPEN_TAG)) {
            $content = $tokens[$index]->getContent().$content;
        }

        if (1 === Preg::match('/\R{1}([ \t]*)$/', $content, $matches)) {
            return $matches[1];
        }

        return null;
    }
private function getIndentAt ( Tokens $ tokens , $ index ) { $ content = '' ; $ lineEnding = $ this -> whitespacesConfig -> getLineEnding ( ) ; // find line ending token for ( $ index ; $ index > 0 ; -- $ index ) { if ( false !== strstr ( $ tokens [ $ index ] -> getContent ( ) , $ lineEnding ) ) { break ; } } if ( $ tokens [ $ index ] -> isWhitespace ( ) ) { $ content = $ tokens [ $ index ] -> getContent ( ) ; -- $ index ; } if ( $ tokens [ $ index ] -> isGivenKind ( T_OPEN_TAG ) ) { $ content = $ tokens [ $ index ] -> getContent ( ) . $ content ; } if ( 1 === Preg :: match ( '/\R{1}([ \t]*)$/' , $ content , $ matches ) ) { return $ matches [ 1 ] ; } return null ; }
@param int $index

@return null|string
@param int $index