src/Parse/UnifiedDiffParser.php
public function parse(array $diffLineList): Changeset
    {
        $tokenList = $this->tokenizer->tokenize($diffLineList);

        $fileList = [];
        $startIndex = 0;
        $tokenCount = count($tokenList);
        for ($i = 0; $i < $tokenCount; $i++) {
            // File begin
            if (Token::ORIGINAL_FILENAME === $tokenList[$i]->getType()) {
                $startIndex = $i;
            }

            // File end, hydrate object
            if ($this->fileEnd($tokenList, $i + 1, Token::ORIGINAL_FILENAME)) {
                $fileList[] = $this->parseFile(
                    array_slice($tokenList, $startIndex, ($i - $startIndex) + 1)
                );
            }
        }

        return new Changeset($fileList);
    }
public function parse(array $diffLineList): Changeset
    {
        $tokenList = $this->tokenizer->tokenize($diffLineList);

        $fileList = [];
        $startIndex = 0;
        $tokenCount = count($tokenList);
        for ($i = 0; $i < $tokenCount; $i++) {
            // File begin
            if (Token::ORIGINAL_FILENAME === $tokenList[$i]->getType()) {
                $startIndex = $i;
            }

            // File end, hydrate object
            if ($this->fileEnd($tokenList, $i + 1, Token::ORIGINAL_FILENAME)) {
                $fileList[] = $this->parseFile(
                    array_slice($tokenList, $startIndex, ($i - $startIndex) + 1)
                );
            }
        }

        return new Changeset($fileList);
    }
public function parse ( array $ diffLineList ) : Changeset { $ tokenList = $ this -> tokenizer -> tokenize ( $ diffLineList ) ; $ fileList = [ ] ; $ startIndex = 0 ; $ tokenCount = count ( $ tokenList ) ; for ( $ i = 0 ; $ i < $ tokenCount ; $ i ++ ) { // File begin if ( Token :: ORIGINAL_FILENAME === $ tokenList [ $ i ] -> getType ( ) ) { $ startIndex = $ i ; } // File end, hydrate object if ( $ this -> fileEnd ( $ tokenList , $ i + 1 , Token :: ORIGINAL_FILENAME ) ) { $ fileList [ ] = $ this -> parseFile ( array_slice ( $ tokenList , $ startIndex , ( $ i - $ startIndex ) + 1 ) ) ; } } return new Changeset ( $ fileList ) ; }
Parse an array of tokens out into an object graph.

@param string[] $diffLineList

@return Changeset
Parse an array of tokens out into an object graph .