src/Parse/UnifiedDiffTokenizer.php
private function getHunkLineToken(
        int &$addedCount,
        int &$removedCount,
        int &$unchangedCount,
        string $diffLine
    ): Token {

        // Line added
        if ('+' === substr($diffLine, 0, 1)) {
            $tokenType = Token::SOURCE_LINE_ADDED;
            $addedCount++;

            // Line removed
        } elseif ('-' === substr($diffLine, 0, 1)) {
            $tokenType = Token::SOURCE_LINE_REMOVED;
            $removedCount++;

            // Line unchanged
        } else {
            $tokenType = Token::SOURCE_LINE_UNCHANGED;
            $unchangedCount++;
        }

        return new Token($tokenType, $this->normalizeChangedLine($diffLine));
    }
private function getHunkLineToken(
        int &$addedCount,
        int &$removedCount,
        int &$unchangedCount,
        string $diffLine
    ): Token {

        // Line added
        if ('+' === substr($diffLine, 0, 1)) {
            $tokenType = Token::SOURCE_LINE_ADDED;
            $addedCount++;

            // Line removed
        } elseif ('-' === substr($diffLine, 0, 1)) {
            $tokenType = Token::SOURCE_LINE_REMOVED;
            $removedCount++;

            // Line unchanged
        } else {
            $tokenType = Token::SOURCE_LINE_UNCHANGED;
            $unchangedCount++;
        }

        return new Token($tokenType, $this->normalizeChangedLine($diffLine));
    }
private function getHunkLineToken ( int & $ addedCount , int & $ removedCount , int & $ unchangedCount , string $ diffLine ) : Token { // Line added if ( '+' === substr ( $ diffLine , 0 , 1 ) ) { $ tokenType = Token :: SOURCE_LINE_ADDED ; $ addedCount ++ ; // Line removed } elseif ( '-' === substr ( $ diffLine , 0 , 1 ) ) { $ tokenType = Token :: SOURCE_LINE_REMOVED ; $ removedCount ++ ; // Line unchanged } else { $ tokenType = Token :: SOURCE_LINE_UNCHANGED ; $ unchangedCount ++ ; } return new Token ( $ tokenType , $ this -> normalizeChangedLine ( $ diffLine ) ) ; }
Get a single line for a hunk.
Get a single line for a hunk .