src/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixer.php
private function getLineBracesCount(Tokens $tokens, $index)
    {
        $opening = 0;
        $closing = 0;

        while (isset($tokens[++$index])) {
            $token = $tokens[$index];
            if ($token->isType(DocLexer::T_NONE) && false !== strpos($token->getContent(), "\n")) {
                break;
            }

            if ($token->isType([DocLexer::T_OPEN_PARENTHESIS, DocLexer::T_OPEN_CURLY_BRACES])) {
                ++$opening;

                continue;
            }

            if (!$token->isType([DocLexer::T_CLOSE_PARENTHESIS, DocLexer::T_CLOSE_CURLY_BRACES])) {
                continue;
            }

            if ($opening > 0) {
                --$opening;
            } else {
                ++$closing;
            }
        }

        return [$opening, $closing];
    }
private function getLineBracesCount(Tokens $tokens, $index)
    {
        $opening = 0;
        $closing = 0;

        while (isset($tokens[++$index])) {
            $token = $tokens[$index];
            if ($token->isType(DocLexer::T_NONE) && false !== strpos($token->getContent(), "\n")) {
                break;
            }

            if ($token->isType([DocLexer::T_OPEN_PARENTHESIS, DocLexer::T_OPEN_CURLY_BRACES])) {
                ++$opening;

                continue;
            }

            if (!$token->isType([DocLexer::T_CLOSE_PARENTHESIS, DocLexer::T_CLOSE_CURLY_BRACES])) {
                continue;
            }

            if ($opening > 0) {
                --$opening;
            } else {
                ++$closing;
            }
        }

        return [$opening, $closing];
    }
private function getLineBracesCount ( Tokens $ tokens , $ index ) { $ opening = 0 ; $ closing = 0 ; while ( isset ( $ tokens [ ++ $ index ] ) ) { $ token = $ tokens [ $ index ] ; if ( $ token -> isType ( DocLexer :: T_NONE ) && false !== strpos ( $ token -> getContent ( ) , "\n" ) ) { break ; } if ( $ token -> isType ( [ DocLexer :: T_OPEN_PARENTHESIS , DocLexer :: T_OPEN_CURLY_BRACES ] ) ) { ++ $ opening ; continue ; } if ( ! $ token -> isType ( [ DocLexer :: T_CLOSE_PARENTHESIS , DocLexer :: T_CLOSE_CURLY_BRACES ] ) ) { continue ; } if ( $ opening > 0 ) { -- $ opening ; } else { ++ $ closing ; } } return [ $ opening , $ closing ] ; }
@param Tokens $tokens
@param int    $index

@return int[]
@param Tokens $tokens @param int $index