private function getGroupStatements(Tokens $tokens, $groupPrefix, $groupOpenIndex, $groupCloseIndex, $comment)
    {
        $statements = [];
        $statement = $groupPrefix;

        for ($i = $groupOpenIndex + 1; $i <= $groupCloseIndex; ++$i) {
            $token = $tokens[$i];

            if ($token->equals(',') && $tokens[$tokens->getNextMeaningfulToken($i)]->equals([CT::T_GROUP_IMPORT_BRACE_CLOSE])) {
                continue;
            }

            if ($token->equalsAny([',', [CT::T_GROUP_IMPORT_BRACE_CLOSE]])) {
                $statements[] = 'use'.$statement.';';
                $statement = $groupPrefix;

                continue;
            }

            if ($token->isWhitespace()) {
                $j = $tokens->getNextMeaningfulToken($i);

                if ($tokens[$j]->equals([T_AS])) {
                    $statement .= ' as ';
                    $i += 2;
                } elseif ($tokens[$j]->equals([T_FUNCTION])) {
                    $statement = ' function'.$statement;
                    $i += 2;
                } elseif ($tokens[$j]->equals([T_CONST])) {
                    $statement = ' const'.$statement;
                    $i += 2;
                }

                if ($token->isWhitespace(" \t") || '//' !== substr($tokens[$i - 1]->getContent(), 0, 2)) {
                    continue;
                }
            }

            $statement .= $token->getContent();
        }

        if ('' !== $comment) {
            $statements[0] .= ' '.$comment;
        }

        return $statements;
    }
private function getGroupStatements(Tokens $tokens, $groupPrefix, $groupOpenIndex, $groupCloseIndex, $comment)
    {
        $statements = [];
        $statement = $groupPrefix;

        for ($i = $groupOpenIndex + 1; $i <= $groupCloseIndex; ++$i) {
            $token = $tokens[$i];

            if ($token->equals(',') && $tokens[$tokens->getNextMeaningfulToken($i)]->equals([CT::T_GROUP_IMPORT_BRACE_CLOSE])) {
                continue;
            }

            if ($token->equalsAny([',', [CT::T_GROUP_IMPORT_BRACE_CLOSE]])) {
                $statements[] = 'use'.$statement.';';
                $statement = $groupPrefix;

                continue;
            }

            if ($token->isWhitespace()) {
                $j = $tokens->getNextMeaningfulToken($i);

                if ($tokens[$j]->equals([T_AS])) {
                    $statement .= ' as ';
                    $i += 2;
                } elseif ($tokens[$j]->equals([T_FUNCTION])) {
                    $statement = ' function'.$statement;
                    $i += 2;
                } elseif ($tokens[$j]->equals([T_CONST])) {
                    $statement = ' const'.$statement;
                    $i += 2;
                }

                if ($token->isWhitespace(" \t") || '
                    continue;
                }
            }

            $statement .= $token->getContent();
        }

        if ('' !== $comment) {
            $statements[0] .= ' '.$comment;
        }

        return $statements;
    }
private function getGroupStatements ( Tokens $ tokens , $ groupPrefix , $ groupOpenIndex , $ groupCloseIndex , $ comment ) { $ statements = [ ] ; $ statement = $ groupPrefix ; for ( $ i = $ groupOpenIndex + 1 ; $ i <= $ groupCloseIndex ; ++ $ i ) { $ token = $ tokens [ $ i ] ; if ( $ token -> equals ( ',' ) && $ tokens [ $ tokens -> getNextMeaningfulToken ( $ i ) ] -> equals ( [ CT :: T_GROUP_IMPORT_BRACE_CLOSE ] ) ) { continue ; } if ( $ token -> equalsAny ( [ ',' , [ CT :: T_GROUP_IMPORT_BRACE_CLOSE ] ] ) ) { $ statements [ ] = 'use' . $ statement . ';' ; $ statement = $ groupPrefix ; continue ; } if ( $ token -> isWhitespace ( ) ) { $ j = $ tokens -> getNextMeaningfulToken ( $ i ) ; if ( $ tokens [ $ j ] -> equals ( [ T_AS ] ) ) { $ statement .= ' as ' ; $ i += 2 ; } elseif ( $ tokens [ $ j ] -> equals ( [ T_FUNCTION ] ) ) { $ statement = ' function' . $ statement ; $ i += 2 ; } elseif ( $ tokens [ $ j ] -> equals ( [ T_CONST ] ) ) { $ statement = ' const' . $ statement ; $ i += 2 ; } if ( $ token -> isWhitespace ( " \t" ) || '//' !== substr ( $ tokens [ $ i - 1 ] -> getContent ( ) , 0 , 2 ) ) { continue ; } } $ statement .= $ token -> getContent ( ) ; } if ( '' !== $ comment ) { $ statements [ 0 ] .= ' ' . $ comment ; } return $ statements ; }
@param Tokens $tokens
@param string $groupPrefix
@param int    $groupOpenIndex
@param int    $groupCloseIndex
@param string $comment

@return string[]
@param Tokens $tokens @param string $groupPrefix @param int $groupOpenIndex @param int $groupCloseIndex @param string $comment