Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / maintenance / getText.php
index f519a79..ca67c83 100644 (file)
@@ -23,6 +23,8 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\Storage\RevisionRecord;
+
 require_once __DIR__ . '/Maintenance.php';
 
 /**
@@ -42,25 +44,25 @@ class GetTextMaint extends Maintenance {
                $titleText = $this->getArg( 0 );
                $title = Title::newFromText( $titleText );
                if ( !$title ) {
-                       $this->error( "$titleText is not a valid title.\n", true );
+                       $this->fatalError( "$titleText is not a valid title.\n" );
                }
 
                $rev = Revision::newFromTitle( $title );
                if ( !$rev ) {
                        $titleText = $title->getPrefixedText();
-                       $this->error( "Page $titleText does not exist.\n", true );
+                       $this->fatalError( "Page $titleText does not exist.\n" );
                }
                $content = $rev->getContent( $this->hasOption( 'show-private' )
-                       ? Revision::RAW
-                       : Revision::FOR_PUBLIC );
+                       ? RevisionRecord::RAW
+                       : RevisionRecord::FOR_PUBLIC );
 
                if ( $content === false ) {
                        $titleText = $title->getPrefixedText();
-                       $this->error( "Couldn't extract the text from $titleText.\n", true );
+                       $this->fatalError( "Couldn't extract the text from $titleText.\n" );
                }
                $this->output( $content->serialize() );
        }
 }
 
-$maintClass = "GetTextMaint";
+$maintClass = GetTextMaint::class;
 require_once RUN_MAINTENANCE_IF_MAIN;