src/Fixer/PhpTag/LinebreakAfterOpeningTagFixer.php
protected function applyFix(\SplFileInfo $file, Tokens $tokens)
    {
        // ignore files with short open tag and ignore non-monolithic files
        if (!$tokens[0]->isGivenKind(T_OPEN_TAG) || !$tokens->isMonolithicPhp()) {
            return;
        }

        $newlineFound = false;
        foreach ($tokens as $token) {
            if ($token->isWhitespace() && false !== strpos($token->getContent(), "\n")) {
                $newlineFound = true;

                break;
            }
        }

        // ignore one-line files
        if (!$newlineFound) {
            return;
        }

        $token = $tokens[0];
        $tokens[0] = new Token([$token->getId(), rtrim($token->getContent()).$this->whitespacesConfig->getLineEnding()]);
    }
protected function applyFix(\SplFileInfo $file, Tokens $tokens)
    {
        // ignore files with short open tag and ignore non-monolithic files
        if (!$tokens[0]->isGivenKind(T_OPEN_TAG) || !$tokens->isMonolithicPhp()) {
            return;
        }

        $newlineFound = false;
        foreach ($tokens as $token) {
            if ($token->isWhitespace() && false !== strpos($token->getContent(), "\n")) {
                $newlineFound = true;

                break;
            }
        }

        // ignore one-line files
        if (!$newlineFound) {
            return;
        }

        $token = $tokens[0];
        $tokens[0] = new Token([$token->getId(), rtrim($token->getContent()).$this->whitespacesConfig->getLineEnding()]);
    }
protected function applyFix ( \ SplFileInfo $ file , Tokens $ tokens ) { // ignore files with short open tag and ignore non-monolithic files if ( ! $ tokens [ 0 ] -> isGivenKind ( T_OPEN_TAG ) || ! $ tokens -> isMonolithicPhp ( ) ) { return ; } $ newlineFound = false ; foreach ( $ tokens as $ token ) { if ( $ token -> isWhitespace ( ) && false !== strpos ( $ token -> getContent ( ) , "\n" ) ) { $ newlineFound = true ; break ; } } // ignore one-line files if ( ! $ newlineFound ) { return ; } $ token = $ tokens [ 0 ] ; $ tokens [ 0 ] = new Token ( [ $ token -> getId ( ) , rtrim ( $ token -> getContent ( ) ) . $ this -> whitespacesConfig -> getLineEnding ( ) ] ) ; }
{@inheritdoc}
{