Property | Type | Description | |
---|---|---|---|
$deleteTreshold | When deleting a large block of text (over ~64 characters), how close do the contents have to be to match the expected contents. (0.0 = perfection, 1.0 = very loose). Note that Match->threshold controls how closely the end points of a delete need to match. | ||
$diff | |||
$margin | Chunk size for context length. | ||
$match |
Method | Description | |
---|---|---|
__construct ( |
||
addContext ( |
Increase the context until it is unique, but don't let the pattern expand beyond Match->maxBits. | |
addPadding ( |
Add some padding on text start and end so that edges can match something. | |
apply ( |
Merge a set of patches onto the text. Return a patched text, as well as a list of true/false values indicating which patches were applied. | |
fromText ( string $patchText ) : |
Parse a textual representation of patches and return a list of patch objects. | |
getDeleteTreshold ( ) : float | ||
getMargin ( ) : integer | ||
make ( string | array $a, string | array | null $b = null, array | null $c = null ) : |
Compute a list of patches to turn text1 into text2. | |
setDeleteTreshold ( float $deleteTreshold ) | ||
setMargin ( integer $margin ) | ||
splitMax ( |
Look through the patches and break up any which are longer than the maximum limit of the match algorithm. | |
toText ( |
Take a list of patches and return a textual representation. |
Method | Description | |
---|---|---|
deepCopy ( |
Given an array of patches, return another array that is identical. | |
getDiff ( ) : |
||
getMatch ( ) : |
public __construct ( |
||
$diff | ||
$match |
public addContext ( |
||
$patch | The patch to grow. | |
$text | string | Source text. |
public addPadding ( |
||
$patches | Array of PatchObjects. | |
return | string | The padding string added to each side. |
protected deepCopy ( |
||
$patches | Array of PatchObjects. | |
return | Array of PatchObjects. |
public make ( string | array $a, string | array | null $b = null, array | null $c = null ) : |
||
$a | string | array | text1 (methods 1,3,4) or Array of diff arrays for text1 to text2 (method 2). |
$b | string | array | null | text2 (methods 1,4) or Array of diff arrays for text1 to text2 (method 3) or null (method 2). |
$c | array | null | Array of diff arrays for text1 to text2 (method 4) or null (methods 1,2,3). |
return | Array of PatchObjects. |
public setDeleteTreshold ( float $deleteTreshold ) | ||
$deleteTreshold | float |
public splitMax ( |
||
$patches | Array of PatchObjects. |
protected $deleteTreshold |