class vB_Text_Diff_Entry

Represents a single entry in a diff.

Can be a group of unchanged, added, deleted, or changed lines.

Traits

Properties

string $data_old Text from the old string.
string $data_new Text from the new string
integer $size The size of the diff
integer $old_start_line The first line index of the old data
integer $new_start_line The first line index of the new data
string $old_class Representative name of the diff state of the old data, relative to the new.
string $new_class Representative name of the diff state of the new data, relative to the old.

Methods

__sleep()

No description

__wakeup()

No description

__construct(string $data_old, string $data_new)

Constructor. Sets up data.

set_line_numbers($old_start_line, $new_start_line)

No description

array
fetch_data_old()

Fetches data from the old string

array
fetch_data_new()

Fetches data from new string

prep_data($data, $start_line)

No description

string
fetch_data_old_class()

Fetches the name of the CSS class that should be used for the data from the old string

string
fetch_data_new_class()

Fetches the name of the CSS class that should be used for the data from the new string

string
prep_diff_text(string $string, boolean $wrap = true)

Prepares a section of text to be displayed in a diff by making it display closer to normal in a browser

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 527
__construct(string $data_old, string $data_new)

Constructor. Sets up data.

Parameters

string $data_old Text from the old string
string $data_new Text from the new string

at line 537
set_line_numbers($old_start_line, $new_start_line)

Parameters

$old_start_line
$new_start_line

at line 548
array fetch_data_old()

Fetches data from the old string

Return Value

array

at line 558
array fetch_data_new()

Fetches data from new string

Return Value

array

at line 563
prep_data($data, $start_line)

Parameters

$data
$start_line

at line 586
string fetch_data_old_class()

Fetches the name of the CSS class that should be used for the data from the old string

Return Value

string

at line 611
string fetch_data_new_class()

Fetches the name of the CSS class that should be used for the data from the new string

Return Value

string

at line 640
string prep_diff_text(string $string, boolean $wrap = true)

Prepares a section of text to be displayed in a diff by making it display closer to normal in a browser

Parameters

string $string Text to prepare
boolean $wrap Whether to allow the text to wrap on its own (false uses code tags, true uses pre tags)

Return Value

string Prepared text