DifferenceEngine minor fixes
authorMax Semenik <maxsem.wiki@gmail.com>
Tue, 29 Oct 2013 23:43:53 +0000 (03:43 +0400)
committerMax Semenik <maxsem.wiki@gmail.com>
Fri, 1 Nov 2013 22:28:13 +0000 (02:28 +0400)
* Function docs
* Remove useless variable assignment

Change-Id: I292e1391e0c24399b2c203b9f7fe7c58df089ad0

includes/diff/DifferenceEngine.php

index 39f8a47..cf78ce0 100644 (file)
@@ -83,7 +83,7 @@ class DifferenceEngine extends ContextSource {
         * Constructor
         * @param $context IContextSource context to use, anything else will be ignored
         * @param $old Integer old ID we want to show and diff with.
-        * @param $new String|int either 'prev' or 'next'. Default: 0.
+        * @param $new String|int either revision ID or 'prev' or 'next'. Default: 0.
         * @param $rcid Integer Deprecated, no longer used!
         * @param $refreshCache boolean If set, refreshes the diff cache
         * @param $unhide boolean If set, allow viewing deleted revs
@@ -230,7 +230,6 @@ class DifferenceEngine extends ContextSource {
                }
 
                $rollback = '';
-               $undoLink = '';
 
                $query = array();
                # Carry over 'diffonly' param via navigation links
@@ -599,7 +598,8 @@ class DifferenceEngine extends ContextSource {
         *
         * @param string|bool $otitle Header for old text or false
         * @param string|bool $ntitle Header for new text or false
-        * @param string $notice
+        * @param string $notice HTML between diff header and body
+        *
         * @return bool
         */
        function showDiff( $otitle, $ntitle, $notice = '' ) {
@@ -867,6 +867,9 @@ class DifferenceEngine extends ContextSource {
        /**
         * Generate a debug comment indicating diff generating time,
         * server node, and generator backend.
+        *
+        * @param String $generator: What diff engine was used
+        *
         * @return string
         */
        protected function debug( $generator = "internal" ) {
@@ -879,16 +882,20 @@ class DifferenceEngine extends ContextSource {
                        $data[] = wfHostname();
                }
                $data[] = wfTimestamp( TS_DB );
-               return "<!-- diff generator: " .
-               implode( " ",
-               array_map(
+               return "<!-- diff generator: "
+                       . implode( " ",
+                               array_map(
                                        "htmlspecialchars",
-               $data ) ) .
-                       " -->\n";
+                               $data )
+                       )
+                       . " -->\n";
        }
 
        /**
         * Replace line numbers with the text in the user's language
+        *
+        * @param String $text
+        *
         * @return mixed
         */
        function localiseLineNumbers( $text ) {
@@ -1008,6 +1015,12 @@ class DifferenceEngine extends ContextSource {
        /**
         * Add the header to a diff body
         *
+        * @param String $diff: Diff body
+        * @param String $otitle: Old revision header
+        * @param String $ntitle: New revision header
+        * @param String $multi: Notice telling user that there are intermediate revisions between the ones being compared
+        * @param String $notice: Other notices, e.g. that user is viewing deleted content
+        *
         * @return string
         */
        function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) {