Merge "Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback"
[lhc/web/wiklou.git] / maintenance / cleanupUploadStash.php
index 14c6a6b..b4bfff0 100644 (file)
@@ -33,7 +33,7 @@ require_once __DIR__ . '/Maintenance.php';
  *
  * @ingroup Maintenance
  */
-class UploadStashCleanup extends Maintenance {
+class CleanupUploadStash extends Maintenance {
 
        public function __construct() {
                parent::__construct();
@@ -122,7 +122,7 @@ class UploadStashCleanup extends Maintenance {
                $iterator = $tempRepo->getBackend()->getFileList( [ 'dir' => $dir, 'adviseStat' => 1 ] );
                $this->output( "Deleting orphaned temp files...\n" );
                if ( strpos( $dir, '/local-temp' ) === false ) { // sanity check
-                       $this->error( "Temp repo is not using the temp container.", 1 ); // die
+                       $this->fatalError( "Temp repo is not using the temp container." );
                }
                $i = 0;
                $batch = []; // operation batch
@@ -147,10 +147,11 @@ class UploadStashCleanup extends Maintenance {
        protected function doOperations( FileRepo $tempRepo, array $ops ) {
                $status = $tempRepo->getBackend()->doQuickOperations( $ops );
                if ( !$status->isOK() ) {
+                       // @phan-suppress-next-line PhanUndeclaredMethod
                        $this->error( print_r( $status->getErrorsArray(), true ) );
                }
        }
 }
 
-$maintClass = "UploadStashCleanup";
+$maintClass = CleanupUploadStash::class;
 require_once RUN_MAINTENANCE_IF_MAIN;