Skip to content

FileDiff

github-actions edited this page Apr 19, 2026 · 1 revision

Carries the result of comparing source and target file contents.


  • Full name: \FastForward\DevTools\Resource\FileDiff
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Constants

Constant Visibility Type Value
STATUS_CHANGED public string 'changed'
STATUS_UNCHANGED public string 'unchanged'
STATUS_BINARY public string 'binary'
STATUS_UNREADABLE public string 'unreadable'

Methods

__construct

Creates a new file diff result.

public __construct(string $status, string $summary, string|null $diff = null): mixed

Parameters:

Parameter Type Description
$status string the comparison status for the source and target files
$summary string the human-readable summary for console output
$diff string|null the optional unified diff payload

getStatus

Returns the comparison status.

public getStatus(): string

Return Value:

the comparison status value


getSummary

Returns the human-readable summary.

public getSummary(): string

Return Value:

the summary for console output


getDiff

Returns the optional unified diff payload.

public getDiff(): string|null

Return Value:

the diff payload, or null when no text diff is available


isUnchanged

Reports whether the compared files already match.

public isUnchanged(): bool

Return Value:

true when the source and target contents are identical


isChanged

Reports whether the compared files produced a text diff.

public isChanged(): bool

Return Value:

true when a text diff is available


Clone this wiki locally