Merge "Remove auto-generated "Constructor" documentation on constructors"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 21 Jul 2017 13:19:44 +0000 (13:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 21 Jul 2017 13:19:44 +0000 (13:19 +0000)
1  2 
includes/context/DerivativeContext.php
includes/diff/DifferenceEngine.php
maintenance/generateSitemap.php

@@@ -75,7 -75,6 +75,6 @@@ class DerivativeContext extends Context
        private $timing;
  
        /**
-        * Constructor
         * @param IContextSource $context Context to inherit from
         */
        public function __construct( IContextSource $context ) {
         *
         * @deprecated since 1.27 use a StatsdDataFactory from MediaWikiServices (preferably injected)
         *
 -       * @return MediawikiStatsdDataFactory
 +       * @return IBufferingStatsdDataFactory
         */
        public function getStats() {
                return MediaWikiServices::getInstance()->getStatsdDataFactory();
@@@ -104,7 -104,6 +104,6 @@@ class DifferenceEngine extends ContextS
        /**#@-*/
  
        /**
-        * Constructor
         * @param IContextSource $context Context to use, anything else will be ignored
         * @param int $old Old ID we want to show and diff with.
         * @param string|int $new Either revision ID or 'prev' or 'next'. Default: 0.
                        }
                }
  
 +              $out->addJsConfigVars( [
 +                      'wgDiffOldId' => $this->mOldid,
 +                      'wgDiffNewId' => $this->mNewid,
 +              ] );
 +
                # Make "next revision link"
                # Skip next link on the top revision
                if ( $samePage && !$this->mNewRev->isCurrent() ) {
                        $wgExternalDiffEngine = false;
                }
  
 +              // Better external diff engine, the 2 may some day be dropped
 +              // This one does the escaping and segmenting itself
                if ( function_exists( 'wikidiff2_do_diff' ) && $wgExternalDiffEngine === false ) {
 -                      # Better external diff engine, the 2 may some day be dropped
 -                      # This one does the escaping and segmenting itself
 -                      $text = wikidiff2_do_diff( $otext, $ntext, 2 );
 +                      $wikidiff2Version = phpversion( 'wikidiff2' );
 +                      if (
 +                              $wikidiff2Version !== false &&
 +                              version_compare( $wikidiff2Version, '0.3.0', '>=' )
 +                      ) {
 +                              $text = wikidiff2_do_diff(
 +                                      $otext,
 +                                      $ntext,
 +                                      2,
 +                                      $this->getConfig()->get( 'WikiDiff2MovedParagraphDetectionCutoff' )
 +                              );
 +                      } else {
 +                              // Don't pass the 4th parameter for compatibility with older versions of wikidiff2
 +                              $text = wikidiff2_do_diff(
 +                                      $otext,
 +                                      $ntext,
 +                                      2
 +                              );
 +
 +                              // Log a warning in case the configuration value is set to not silently ignore it
 +                              if ( $this->getConfig()->get( 'WikiDiff2MovedParagraphDetectionCutoff' ) > 0 ) {
 +                                      wfLogWarning( '$wgWikiDiff2MovedParagraphDetectionCutoff is set but has no
 +                                              effect since the used version of WikiDiff2 does not support it.' );
 +                              }
 +                      }
 +
                        $text .= $this->debug( 'wikidiff2' );
  
                        return $text;
@@@ -140,9 -140,6 +140,6 @@@ class GenerateSitemap extends Maintenan
         */
        private $identifier;
  
-       /**
-        * Constructor
-        */
        public function __construct() {
                parent::__construct();
                $this->addDescription( 'Creates a sitemap for the site' );
                }
                $this->identifier = $this->getOption( 'identifier', wfWikiID() );
                $this->compress = $this->getOption( 'compress', 'yes' ) !== 'no';
 -              $this->skipRedirects = $this->getOption( 'skip-redirects', false ) !== false;
 +              $this->skipRedirects = $this->hasOption( 'skip-redirects' );
                $this->dbr = $this->getDB( DB_REPLICA );
                $this->generateNamespaces();
                $this->timestamp = wfTimestamp( TS_ISO_8601, wfTimestampNow() );