src/CodeFile.php
private function renderDiff($lines1, $lines2)
    {
        if (!is_array($lines1)) {
            $lines1 = explode("\n", $lines1);
        }
        if (!is_array($lines2)) {
            $lines2 = explode("\n", $lines2);
        }
        foreach ($lines1 as $i => $line) {
            $lines1[$i] = rtrim($line, "\r\n");
        }
        foreach ($lines2 as $i => $line) {
            $lines2[$i] = rtrim($line, "\r\n");
        }

        $renderer = new DiffRendererHtmlInline();
        $diff = new \Diff($lines1, $lines2);

        return $diff->render($renderer);
    }
private function renderDiff($lines1, $lines2)
    {
        if (!is_array($lines1)) {
            $lines1 = explode("\n", $lines1);
        }
        if (!is_array($lines2)) {
            $lines2 = explode("\n", $lines2);
        }
        foreach ($lines1 as $i => $line) {
            $lines1[$i] = rtrim($line, "\r\n");
        }
        foreach ($lines2 as $i => $line) {
            $lines2[$i] = rtrim($line, "\r\n");
        }

        $renderer = new DiffRendererHtmlInline();
        $diff = new \Diff($lines1, $lines2);

        return $diff->render($renderer);
    }
private function renderDiff ( $ lines1 , $ lines2 ) { if ( ! is_array ( $ lines1 ) ) { $ lines1 = explode ( "\n" , $ lines1 ) ; } if ( ! is_array ( $ lines2 ) ) { $ lines2 = explode ( "\n" , $ lines2 ) ; } foreach ( $ lines1 as $ i => $ line ) { $ lines1 [ $ i ] = rtrim ( $ line , "\r\n" ) ; } foreach ( $ lines2 as $ i => $ line ) { $ lines2 [ $ i ] = rtrim ( $ line , "\r\n" ) ; } $ renderer = new DiffRendererHtmlInline ( ) ; $ diff = new \ Diff ( $ lines1 , $ lines2 ) ; return $ diff -> render ( $ renderer ) ; }
Renders diff between two sets of lines

@param mixed $lines1
@param mixed $lines2
@return string
Renders diff between two sets of lines