X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdiff%2FDairikiDiff.php;h=d76af31aea96fc2f5b298e95b99701a97d51cc41;hb=33eabfd8d6a738ae3ed13e3f52c0bbd7664e581a;hp=dbb32e604c07d315f44cb8dfa348d6b97fadaefc;hpb=5fd224c00b940f75c1f83e56b99961be94bde70a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php index dbb32e604c..d76af31aea 100644 --- a/includes/diff/DairikiDiff.php +++ b/includes/diff/DairikiDiff.php @@ -67,7 +67,7 @@ abstract class DiffOp { /** * @param int $i - * @return string|null + * @return string[]|string|null */ public function getClosing( $i = null ) { if ( $i === null ) { @@ -205,15 +205,22 @@ class Diff { public $edits; /** - * Constructor. + * @var int If this diff complexity is exceeded, a ComplexityException is thrown + * 0 means no limit. + */ + protected $bailoutComplexity = 0; + + /** * Computes diff between sequences of strings. * * @param string[] $from_lines An array of strings. * Typically these are lines from a file. * @param string[] $to_lines An array of strings. + * @throws \MediaWiki\Diff\ComplexityException */ public function __construct( $from_lines, $to_lines ) { $eng = new DiffEngine; + $eng->setBailoutComplexity( $this->bailoutComplexity ); $this->edits = $eng->diff( $from_lines, $to_lines ); }