installer: Fix warningBox arguments in WebInstallerRestart
[lhc/web/wiklou.git] / maintenance / addSite.php
index 1ebc4f6..8fb0d68 100644 (file)
@@ -11,7 +11,7 @@ require_once $basePath . '/maintenance/Maintenance.php';
  *
  * @since 1.29
  *
- * @license GNU GPL v2+
+ * @license GPL-2.0-or-later
  * @author Florian Schmidt
  */
 class AddSite extends Maintenance {
@@ -35,10 +35,14 @@ class AddSite extends Maintenance {
        /**
         * Imports the site described by the parameters (see self::__construct()) passed to this
         * maintenance sccript into the sites table of MediaWiki.
+        * @return bool
         */
        public function execute() {
                $siteStore = MediaWikiServices::getInstance()->getSiteStore();
-               $siteStore->reset();
+               if ( method_exists( $siteStore, 'reset' ) ) {
+                       // @phan-suppress-next-line PhanUndeclaredMethod
+                       $siteStore->reset();
+               }
 
                $globalId = $this->getArg( 0 );
                $group = $this->getArg( 1 );
@@ -80,6 +84,7 @@ class AddSite extends Maintenance {
                $siteStore->saveSites( [ $site ] );
 
                if ( method_exists( $siteStore, 'reset' ) ) {
+                       // @phan-suppress-next-line PhanUndeclaredMethod
                        $siteStore->reset();
                }
 
@@ -87,5 +92,5 @@ class AddSite extends Maintenance {
        }
 }
 
-$maintClass = 'AddSite';
+$maintClass = AddSite::class;
 require_once RUN_MAINTENANCE_IF_MAIN;