Merge "Rename autonym for 'no' from 'norsk bokmål' to 'norsk'"
[lhc/web/wiklou.git] / includes / diff / DairikiDiff.php
index dbb32e6..d76af31 100644 (file)
@@ -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 );
        }