UnifiedDiffOutputBuilder
extends AbstractChunkOutputBuilder
in package
FinalYes
Builds a diff string representation in unified diff format in chunks.
Table of Contents
Methods
- __construct() : mixed
- getDiff() : string
- getCommonChunks() : array<string|int, mixed>
- Takes input of the diff array and returns the common parts.
Methods
__construct()
public
__construct([string $header = "--- Original
+++ New
" ][, bool $addLineNumbers = false ]) : mixed
Parameters
- $header : string = "--- Original +++ New "
- $addLineNumbers : bool = false
getDiff()
public
getDiff(array<string|int, mixed> $diff) : string
Parameters
- $diff : array<string|int, mixed>
Return values
stringgetCommonChunks()
Takes input of the diff array and returns the common parts.
protected
getCommonChunks(array<string|int, mixed> $diff[, int $lineThreshold = 5 ]) : array<string|int, mixed>
Iterates through diff line by line.
Parameters
- $diff : array<string|int, mixed>
- $lineThreshold : int = 5