jenkins-bot has submitted this change and it was merged.

Change subject: Initialise variables and update documentation
......................................................................


Initialise variables and update documentation

Change-Id: Idb242f65801ee79531c2300cf9fcb5b3929f66ab
---
M includes/diff/DairikiDiff.php
M includes/diff/DiffFormatter.php
2 files changed, 10 insertions(+), 4 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php
index 37f1e59..2781597 100644
--- a/includes/diff/DairikiDiff.php
+++ b/includes/diff/DairikiDiff.php
@@ -384,6 +384,8 @@
                                if ( empty( $ymatches[$line] ) ) {
                                        continue;
                                }
+
+                               $k = 0;
                                $matches = $ymatches[$line];
                                reset( $matches );
                                while ( list( , $y ) = each( $matches ) ) {
@@ -394,6 +396,7 @@
                                                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 428e97d..66faea8 100644
--- a/includes/diff/DiffFormatter.php
+++ b/includes/diff/DiffFormatter.php
@@ -66,6 +66,8 @@
 
                $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 @@
        }
 
        /**
-        * @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__ );

-- 
To view, visit https://gerrit.wikimedia.org/r/96573
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb242f65801ee79531c2300cf9fcb5b3929f66ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to