Documentation

StrictUnifiedDiffOutputBuilder
in package
implements DiffOutputBuilderInterface

Strict Unified diff output builder.

Generates (strict) Unified diff's (unidiffs) with hunks.

Interfaces, Classes and Traits

DiffOutputBuilderInterface
Defines how an output builder should take a generated diff array and return a string representation of that diff.

Table of Contents

$changed  : bool
$collapseRanges  : bool
$commonLineThreshold  : int
$contextLines  : int
$default  : mixed
$header  : string
__construct()  : mixed
getDiff()  : mixed
writeDiffHunks()  : mixed
writeHunk()  : mixed

Properties

$default

private static mixed $default = [ 'collapseRanges' => true, // ranges of length one are rendered with the trailing `,1` 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 'fromFile' => null, 'fromFileDate' => null, 'toFile' => null, 'toFileDate' => null, ]

Methods

__construct()

public __construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []
Return values
mixed

getDiff()

public getDiff(array<string|int, mixed> $diff) : mixed
Parameters
$diff : array<string|int, mixed>
Return values
mixed

writeDiffHunks()

private writeDiffHunks(mixed $output, array<string|int, mixed> $diff) : mixed
Parameters
$output : mixed
$diff : array<string|int, mixed>
Return values
mixed

writeHunk()

private writeHunk(array<string|int, mixed> $diff, mixed $diffStartIndex, mixed $diffEndIndex, mixed $fromStart, mixed $fromRange, mixed $toStart, mixed $toRange, mixed $output) : mixed
Parameters
$diff : array<string|int, mixed>
$diffStartIndex : mixed
$diffEndIndex : mixed
$fromStart : mixed
$fromRange : mixed
$toStart : mixed
$toRange : mixed
$output : mixed
Return values
mixed

Search results