public static function parse($diff)
    {
        if ('' === $diff) {
            return array();
        }

        $lines = explode("\n", $diff);
        $nbLines = count($lines);
        $curLine = 0;
        $chunks = array();

        while ($curLine < $nbLines) {
            $chunks[] = self::parseChunk($lines, $nbLines, $curLine);
        }

        return $chunks;
    }
public static function parse($diff)
    {
        if ('' === $diff) {
            return array();
        }

        $lines = explode("\n", $diff);
        $nbLines = count($lines);
        $curLine = 0;
        $chunks = array();

        while ($curLine < $nbLines) {
            $chunks[] = self::parseChunk($lines, $nbLines, $curLine);
        }

        return $chunks;
    }
public static function parse ( $ diff ) { if ( '' === $ diff ) { return array ( ) ; } $ lines = explode ( "\n" , $ diff ) ; $ nbLines = count ( $ lines ) ; $ curLine = 0 ; $ chunks = array ( ) ; while ( $ curLine < $ nbLines ) { $ chunks [ ] = self :: parseChunk ( $ lines , $ nbLines , $ curLine ) ; } return $ chunks ; }
Parser for Github's DIFF format.

@param string $diff
@return array an array of chunks
Parser for Github s DIFF format .