class Diff extends Diff (View source)

Class representing a 'diff' between two sequences of strings.

Properties

static $html_cleaner_class

Methods

static mixed|string
cleanHTML(string $content, HTMLCleaner $cleaner = null)

Attempt to clean invalid HTML, which messes up diffs.

static string
compareHTML(string $from, string $to, bool $escape = false)

No description

static array
getHTMLChunks(string|bool|array $content)

No description

Details

static mixed|string cleanHTML(string $content, HTMLCleaner $cleaner = null)

Attempt to clean invalid HTML, which messes up diffs.

This cleans code if possible, using an instance of HTMLCleaner

NB: By default, only extremely simple tidying is performed, by passing through DomDocument::loadHTML and saveXML

Parameters

string $content

HTML content

HTMLCleaner $cleaner

Optional instance of a HTMLCleaner class to use, overriding self::$html_cleaner_class

Return Value

mixed|string

static string compareHTML(string $from, string $to, bool $escape = false)

Parameters

string $from
string $to
bool $escape

Return Value

string

static array getHTMLChunks(string|bool|array $content)

Parameters

string|bool|array $content

If passed as an array, values will be concatenated with a comma.

Return Value

array