From: jenkins-bot Date: Wed, 20 Nov 2013 21:59:27 +0000 (+0000) Subject: Merge "Initialise variables and update documentation" X-Git-Tag: 1.31.0-rc.0~17987 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=debe941aa842af64f35663660594788086fe5727;hp=424845ad11f2e636d602b9009314c1748e92a7c3;p=lhc%2Fweb%2Fwiklou.git Merge "Initialise variables and update documentation" --- diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php index c27ed1fcb9..f80a4ad0f3 100644 --- a/includes/diff/DairikiDiff.php +++ b/includes/diff/DairikiDiff.php @@ -384,6 +384,8 @@ class DiffEngine { if ( empty( $ymatches[$line] ) ) { continue; } + + $k = 0; $matches = $ymatches[$line]; reset( $matches ); while ( list( , $y ) = each( $matches ) ) { @@ -394,6 +396,7 @@ class DiffEngine { break; } } + while ( list( , $y ) = each( $matches ) ) { if ( $y > $this->seq[$k - 1] ) { assert( '$y < $this->seq[$k]' ); diff --git a/includes/diff/DiffFormatter.php b/includes/diff/DiffFormatter.php index 7f253d2779..d9e1c95fc6 100644 --- a/includes/diff/DiffFormatter.php +++ b/includes/diff/DiffFormatter.php @@ -66,6 +66,8 @@ abstract class DiffFormatter { $this->startDiff(); + // Initialize $x0 and $y0 to prevent IDEs from getting confused. + $x0 = $y0 = 0; foreach ( $diff->edits as $edit ) { if ( $edit->type == 'copy' ) { if ( is_array( $block ) ) { @@ -117,11 +119,12 @@ abstract class DiffFormatter { } /** - * @param $xbeg - * @param $xlen - * @param $ybeg - * @param $ylen + * @param int $xbeg + * @param int $xlen + * @param int $ybeg + * @param int $ylen * @param $edits + * @throws MWException */ protected function block( $xbeg, $xlen, $ybeg, $ylen, &$edits ) { wfProfileIn( __METHOD__ );