WebInstallerUpgrade: Simplify return paths
authorFomafix <fomafix@googlemail.com>
Sun, 18 Nov 2018 17:33:45 +0000 (18:33 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 1 Dec 2018 21:31:27 +0000 (21:31 +0000)
* Avoid else after return.
* Combine redundant return values.

Change-Id: If87f5b2163abc7867ce83081aa6ab9e358869060

includes/installer/WebInstallerUpgrade.php

index a6157b5..46efc40 100644 (file)
@@ -39,14 +39,13 @@ class WebInstallerUpgrade extends WebInstallerPage {
                        if ( $this->parent->request->wasPosted() && !$this->getVar( '_ExistingDBSettings' ) ) {
                                // Done message acknowledged
                                return 'continue';
-                       } else {
-                               // Back button click
-                               // Show the done message again
-                               // Make them click back again if they want to do the upgrade again
-                               $this->showDoneMessage();
-
-                               return 'output';
                        }
+                       // Back button click
+                       // Show the done message again
+                       // Make them click back again if they want to do the upgrade again
+                       $this->showDoneMessage();
+
+                       return 'output';
                }
 
                // wgDBtype is generally valid here because otherwise the previous page
@@ -73,15 +72,13 @@ class WebInstallerUpgrade extends WebInstallerPage {
                                }
                                $this->setVar( '_UpgradeDone', true );
                                $this->showDoneMessage();
-
-                               return 'output';
                        } else {
                                $this->startForm();
                                $this->parent->showError( 'config-upgrade-error' );
                                $this->endForm();
-
-                               return 'output';
                        }
+
+                       return 'output';
                }
 
                $this->startForm();