COPY
COPY = 'copy'
Lines present in both values.
One run of lines that a diff says are the same, added, removed or changed.
Structured rather than a formatted string, because the operator-facing table needs a class per
line and a formatted diff would have to be parsed back to get one. Core's DiffFormatter produces
classic diff text, which is the right output for a patch and the wrong one for a table with two
columns.
Line numbers are 1-based and are the numbers in the value the lines came from, so a hunk deep in a long field reports where it is rather than where it is in the hunk.
__construct(string $type, list$before = [], list $after = [], int $beforeLine = 0, int $afterLine = 0) : mixed
Constructs a hunk.
| string | $type | One of COPY, ADD, DELETE or CHANGE. |
| list |
$before | Lines as they were. |
| list |
$after | Lines as they became. |
| int | $beforeLine | The line the earlier run starts at, counting from one. |
| int | $afterLine | The line the later run starts at, counting from one. |