FileDiff
Carries the result of comparing source and target file contents.
Constants
Properties
Methods
Creates a new file diff result.
Returns the optional unified diff payload.
Returns the comparison status.
Returns the human-readable summary.
Reports whether the compared files produced a text diff.
Reports whether the compared files already match.
public
string
STATUS_BINARY
=
'binary'
Description
indicates that a text diff should not be rendered for the compared files
public
string
STATUS_CHANGED
=
'changed'
Description
indicates that the source and target differ and a text diff is available
public
string
STATUS_UNCHANGED
=
'unchanged'
Description
indicates that the source and target already match
public
string
STATUS_UNREADABLE
=
'unreadable'
Description
indicates that the compared files could not be read safely
Creates a new file diff result.
public
__construct(
string
$status,
string
$summary[,
string|null
$diff = null]) : mixed
Parameters
$status
:
string
Description
the comparison status for the source and target files
$summary
:
string
Description
the human-readable summary for console output
$diff
:
string|null
=
null
Description
the optional unified diff payload
Returns the optional unified diff payload.
public
getDiff() : string|null
Return values
Description
the diff payload, or null when no text diff is available
Returns the comparison status.
public
getStatus() : string
Return values
Description
the comparison status value
Returns the human-readable summary.
public
getSummary() : string
Return values
Description
the summary for console output
Reports whether the compared files produced a text diff.
public
isChanged() : bool
Return values
Description
true when a text diff is available
Reports whether the compared files already match.
public
isUnchanged() : bool
Return values
Description
true when the source and target contents are identical