public function format(Diff
$diff) { $xi =
$yi = 1;
$block = FALSE;
$context =
[];
$nlead =
$this->leading_context_lines;
$ntrail =
$this->trailing_context_lines;
$this->
_start_diff();
foreach ($diff->
getEdits() as $edit) { if ($edit->type == 'copy'
) { if (is_array($block)) { if (sizeof($edit->orig
) <=
$nlead +
$ntrail) { $block[] =
$edit;
} else { if ($ntrail) { $context =
array_slice($edit->orig, 0,
$ntrail);
$block[] =
new DiffOpCopy($context);
}