PhpCsFixer\Fixer\ControlStructure\IncludeFixer::clearIncludies PHP Method

clearIncludies() private method

private clearIncludies ( Tokens $tokens, array $includies )
$tokens PhpCsFixer\Tokenizer\Tokens
$includies array
    private function clearIncludies(Tokens $tokens, array $includies)
    {
        foreach (array_reverse($includies) as $includy) {
            if ($includy['end'] && !$tokens[$includy['end']]->isGivenKind(T_CLOSE_TAG)) {
                $tokens->removeLeadingWhitespace($includy['end']);
            }
            $braces = $includy['braces'];
            if ($braces) {
                $nextToken = $tokens[$tokens->getNextMeaningfulToken($braces['close'])];
                if ($nextToken->equalsAny(array(';', array(T_CLOSE_TAG)))) {
                    $tokens->removeLeadingWhitespace($braces['open']);
                    $tokens->removeTrailingWhitespace($braces['open']);
                    $tokens->removeLeadingWhitespace($braces['close']);
                    $tokens->removeTrailingWhitespace($braces['close']);
                    $tokens[$braces['open']] = new Token(array(T_WHITESPACE, ' '));
                    $tokens[$braces['close']]->clear();
                }
            }
            $nextIndex = $includy['begin'] + 1;
            $nextToken = $tokens[$nextIndex];
            while ($nextToken->isEmpty()) {
                $nextToken = $tokens[++$nextIndex];
            }
            if ($nextToken->isWhitespace()) {
                $nextToken->setContent(' ');
            } elseif ($braces || $tokens[$nextIndex]->isGivenKind(array(T_VARIABLE, T_CONSTANT_ENCAPSED_STRING, T_COMMENT))) {
                $tokens->insertAt($includy['begin'] + 1, new Token(array(T_WHITESPACE, ' ')));
            }
        }
    }