Merge "profiler: Simplify code for class name mapping"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 18 Nov 2014 20:56:11 +0000 (20:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 18 Nov 2014 20:56:11 +0000 (20:56 +0000)
includes/profiler/Profiler.php

index 0df3468..f2bdc84 100644 (file)
@@ -157,11 +157,11 @@ abstract class Profiler {
                }
 
                foreach ( $output as $outType ) {
-                       if ( isset( self::$outputTypes[$outType] ) ) {
-                               $class = self::$outputTypes[$outType];
-                       } else {
+                       if ( !isset( self::$outputTypes[$outType] ) ) {
                                throw new MWException( "'$outType' is an invalid output type" );
                        }
+                       $class = self::$outputTypes[$outType];
+
                        /** @var ProfilerOutput $profileOut */
                        $profileOut = new $class( $this, $this->params );
                        if ( $profileOut->canUse() ) {