Follows-up
000c6529d. Handle errors first.
Change-Id: I70308783a2e8b140b3c850758cce36544b32eb20
}
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() ) {