Remove deprecated pass-by-reference from the Text_Diff external library. Upstream is not back compat. see #24372.
git-svn-id: http://core.svn.wordpress.org/trunk@24362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b8ce442044
commit
4a067e8949
|
@ -377,7 +377,7 @@ class Text_Diff_Op_copy extends Text_Diff_Op {
|
||||||
|
|
||||||
function &reverse()
|
function &reverse()
|
||||||
{
|
{
|
||||||
$reverse = &new Text_Diff_Op_copy($this->final, $this->orig);
|
$reverse = new Text_Diff_Op_copy($this->final, $this->orig);
|
||||||
return $reverse;
|
return $reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ class Text_Diff_Op_delete extends Text_Diff_Op {
|
||||||
|
|
||||||
function &reverse()
|
function &reverse()
|
||||||
{
|
{
|
||||||
$reverse = &new Text_Diff_Op_add($this->orig);
|
$reverse = new Text_Diff_Op_add($this->orig);
|
||||||
return $reverse;
|
return $reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ class Text_Diff_Op_add extends Text_Diff_Op {
|
||||||
|
|
||||||
function &reverse()
|
function &reverse()
|
||||||
{
|
{
|
||||||
$reverse = &new Text_Diff_Op_delete($this->final);
|
$reverse = new Text_Diff_Op_delete($this->final);
|
||||||
return $reverse;
|
return $reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ class Text_Diff_Op_change extends Text_Diff_Op {
|
||||||
|
|
||||||
function &reverse()
|
function &reverse()
|
||||||
{
|
{
|
||||||
$reverse = &new Text_Diff_Op_change($this->final, $this->orig);
|
$reverse = new Text_Diff_Op_change($this->final, $this->orig);
|
||||||
return $reverse;
|
return $reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ class Text_Diff_Engine_native {
|
||||||
++$yi;
|
++$yi;
|
||||||
}
|
}
|
||||||
if ($copy) {
|
if ($copy) {
|
||||||
$edits[] = &new Text_Diff_Op_copy($copy);
|
$edits[] = new Text_Diff_Op_copy($copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find deletes & adds.
|
// Find deletes & adds.
|
||||||
|
@ -119,11 +119,11 @@ class Text_Diff_Engine_native {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($delete && $add) {
|
if ($delete && $add) {
|
||||||
$edits[] = &new Text_Diff_Op_change($delete, $add);
|
$edits[] = new Text_Diff_Op_change($delete, $add);
|
||||||
} elseif ($delete) {
|
} elseif ($delete) {
|
||||||
$edits[] = &new Text_Diff_Op_delete($delete);
|
$edits[] = new Text_Diff_Op_delete($delete);
|
||||||
} elseif ($add) {
|
} elseif ($add) {
|
||||||
$edits[] = &new Text_Diff_Op_add($add);
|
$edits[] = new Text_Diff_Op_add($add);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ class Text_Diff_Engine_string {
|
||||||
do {
|
do {
|
||||||
$diff1[] = substr($diff[$i], 1);
|
$diff1[] = substr($diff[$i], 1);
|
||||||
} while (++$i < $end && substr($diff[$i], 0, 1) == ' ');
|
} while (++$i < $end && substr($diff[$i], 0, 1) == ' ');
|
||||||
$edits[] = &new Text_Diff_Op_copy($diff1);
|
$edits[] = new Text_Diff_Op_copy($diff1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '+':
|
case '+':
|
||||||
|
@ -107,7 +107,7 @@ class Text_Diff_Engine_string {
|
||||||
do {
|
do {
|
||||||
$diff1[] = substr($diff[$i], 1);
|
$diff1[] = substr($diff[$i], 1);
|
||||||
} while (++$i < $end && substr($diff[$i], 0, 1) == '+');
|
} while (++$i < $end && substr($diff[$i], 0, 1) == '+');
|
||||||
$edits[] = &new Text_Diff_Op_add($diff1);
|
$edits[] = new Text_Diff_Op_add($diff1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
|
@ -121,9 +121,9 @@ class Text_Diff_Engine_string {
|
||||||
$diff2[] = substr($diff[$i++], 1);
|
$diff2[] = substr($diff[$i++], 1);
|
||||||
}
|
}
|
||||||
if (count($diff2) == 0) {
|
if (count($diff2) == 0) {
|
||||||
$edits[] = &new Text_Diff_Op_delete($diff1);
|
$edits[] = new Text_Diff_Op_delete($diff1);
|
||||||
} else {
|
} else {
|
||||||
$edits[] = &new Text_Diff_Op_change($diff1, $diff2);
|
$edits[] = new Text_Diff_Op_change($diff1, $diff2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ class Text_Diff_Engine_string {
|
||||||
$array[] = substr($diff[$j++], 2);
|
$array[] = substr($diff[$j++], 2);
|
||||||
}
|
}
|
||||||
if (count($array) > 0) {
|
if (count($array) > 0) {
|
||||||
$edits[] = &new Text_Diff_Op_copy($array);
|
$edits[] = new Text_Diff_Op_copy($array);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($i < $max_i) {
|
if ($i < $max_i) {
|
||||||
|
@ -203,21 +203,21 @@ class Text_Diff_Engine_string {
|
||||||
$diff2[] = substr($diff[$j++], 2);
|
$diff2[] = substr($diff[$j++], 2);
|
||||||
}
|
}
|
||||||
} while (++$i < $max_i && substr($diff[$i], 0, 1) == '!');
|
} while (++$i < $max_i && substr($diff[$i], 0, 1) == '!');
|
||||||
$edits[] = &new Text_Diff_Op_change($diff1, $diff2);
|
$edits[] = new Text_Diff_Op_change($diff1, $diff2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '+':
|
case '+':
|
||||||
do {
|
do {
|
||||||
$diff1[] = substr($diff[$i], 2);
|
$diff1[] = substr($diff[$i], 2);
|
||||||
} while (++$i < $max_i && substr($diff[$i], 0, 1) == '+');
|
} while (++$i < $max_i && substr($diff[$i], 0, 1) == '+');
|
||||||
$edits[] = &new Text_Diff_Op_add($diff1);
|
$edits[] = new Text_Diff_Op_add($diff1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
do {
|
do {
|
||||||
$diff1[] = substr($diff[$i], 2);
|
$diff1[] = substr($diff[$i], 2);
|
||||||
} while (++$i < $max_i && substr($diff[$i], 0, 1) == '-');
|
} while (++$i < $max_i && substr($diff[$i], 0, 1) == '-');
|
||||||
$edits[] = &new Text_Diff_Op_delete($diff1);
|
$edits[] = new Text_Diff_Op_delete($diff1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,14 +229,14 @@ class Text_Diff_Engine_string {
|
||||||
do {
|
do {
|
||||||
$diff2[] = substr($diff[$j++], 2);
|
$diff2[] = substr($diff[$j++], 2);
|
||||||
} while ($j < $max_j && substr($diff[$j], 0, 1) == '+');
|
} while ($j < $max_j && substr($diff[$j], 0, 1) == '+');
|
||||||
$edits[] = &new Text_Diff_Op_add($diff2);
|
$edits[] = new Text_Diff_Op_add($diff2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
do {
|
do {
|
||||||
$diff2[] = substr($diff[$j++], 2);
|
$diff2[] = substr($diff[$j++], 2);
|
||||||
} while ($j < $max_j && substr($diff[$j], 0, 1) == '-');
|
} while ($j < $max_j && substr($diff[$j], 0, 1) == '-');
|
||||||
$edits[] = &new Text_Diff_Op_delete($diff2);
|
$edits[] = new Text_Diff_Op_delete($diff2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,15 +45,15 @@ class Text_Diff_Engine_xdiff {
|
||||||
}
|
}
|
||||||
switch ($line[0]) {
|
switch ($line[0]) {
|
||||||
case ' ':
|
case ' ':
|
||||||
$edits[] = &new Text_Diff_Op_copy(array(substr($line, 1)));
|
$edits[] = new Text_Diff_Op_copy(array(substr($line, 1)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '+':
|
case '+':
|
||||||
$edits[] = &new Text_Diff_Op_add(array(substr($line, 1)));
|
$edits[] = new Text_Diff_Op_add(array(substr($line, 1)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
$edits[] = &new Text_Diff_Op_delete(array(substr($line, 1)));
|
$edits[] = new Text_Diff_Op_delete(array(substr($line, 1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ class Text_Diff_Renderer {
|
||||||
/* Create a new block with as many lines as we need
|
/* Create a new block with as many lines as we need
|
||||||
* for the trailing context. */
|
* for the trailing context. */
|
||||||
$context = array_slice($edit->orig, 0, $ntrail);
|
$context = array_slice($edit->orig, 0, $ntrail);
|
||||||
$block[] = &new Text_Diff_Op_copy($context);
|
$block[] = new Text_Diff_Op_copy($context);
|
||||||
}
|
}
|
||||||
/* @todo */
|
/* @todo */
|
||||||
$output .= $this->_block($x0, $ntrail + $xi - $x0,
|
$output .= $this->_block($x0, $ntrail + $xi - $x0,
|
||||||
|
@ -118,7 +118,7 @@ class Text_Diff_Renderer {
|
||||||
$y0 = $yi - count($context);
|
$y0 = $yi - count($context);
|
||||||
$block = array();
|
$block = array();
|
||||||
if ($context) {
|
if ($context) {
|
||||||
$block[] = &new Text_Diff_Op_copy($context);
|
$block[] = new Text_Diff_Op_copy($context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$block[] = $edit;
|
$block[] = $edit;
|
||||||
|
|
Loading…
Reference in New Issue