Add $wgDiffEngine
[lhc/web/wiklou.git] / includes / content / ContentHandler.php
index ea5ab78..0e8b5bc 100644 (file)
@@ -26,7 +26,7 @@
  * @author Daniel Kinzler
  */
 
-use MediaWiki\Storage\RevisionRecord;
+use MediaWiki\Revision\RevisionRecord;
 use Wikimedia\Assert\Assert;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
@@ -280,8 +280,10 @@ abstract class ContentHandler {
                        }
 
                        if ( !( $handler instanceof ContentHandler ) ) {
-                               throw new MWException( "$classOrCallback from \$wgContentHandlers is not " .
-                                       "compatible with ContentHandler" );
+                               throw new MWException(
+                                       var_export( $classOrCallback, true ) . " from \$wgContentHandlers is not " .
+                                       "compatible with ContentHandler"
+                               );
                        }
                }
 
@@ -649,7 +651,7 @@ abstract class ContentHandler {
                $slotDiffRenderer->setLanguage( $contentLanguage );
 
                $engine = DifferenceEngine::getEngine();
-               if ( $engine === false ) {
+               if ( $engine === 'php' ) {
                        $slotDiffRenderer->setEngine( TextSlotDiffRenderer::ENGINE_PHP );
                } elseif ( $engine === 'wikidiff2' ) {
                        $slotDiffRenderer->setEngine( TextSlotDiffRenderer::ENGINE_WIKIDIFF2 );
@@ -1100,7 +1102,7 @@ abstract class ContentHandler {
         * @param Revision|Content $undoafter Must be from an earlier revision than $undo
         * @param bool $undoIsLatest Set true if $undo is from the current revision (since 1.32)
         *
-        * @return mixed Content on success, false on failure
+        * @return Content|false Content on success, false on failure
         */
        public function getUndoContent( $current, $undo, $undoafter, $undoIsLatest = false ) {
                Assert::parameterType( Revision::class . '|' . Content::class, $current, '$current' );
@@ -1258,6 +1260,7 @@ abstract class ContentHandler {
         * @since 1.28
         */
        public function getFieldsForSearchIndex( SearchEngine $engine ) {
+               $fields = [];
                $fields['category'] = $engine->makeSearchFieldMapping(
                        'category',
                        SearchIndexField::INDEX_TYPE_TEXT