Collapse some nested if statements
[lhc/web/wiklou.git] / includes / api / ApiHelp.php
index 72509c2..1656e7c 100644 (file)
@@ -44,6 +44,7 @@ class ApiHelp extends ApiBase {
                $context->setLanguage( $this->getMain()->getLanguage() );
                $context->setTitle( SpecialPage::getTitleFor( 'ApiHelp' ) );
                $out = new OutputPage( $context );
+               $out->setRobotPolicy( 'noindex,nofollow' );
                $out->setCopyrightUrl( 'https://www.mediawiki.org/wiki/Special:MyLanguage/Copyright' );
                $context->setOutput( $out );
 
@@ -101,7 +102,6 @@ class ApiHelp extends ApiBase {
                        'mediawiki.apihelp',
                ] );
                if ( !empty( $options['toc'] ) ) {
-                       $out->addModules( 'mediawiki.toc' );
                        $out->addModuleStyles( 'mediawiki.toc.styles' );
                }
                $out->setPageTitle( $context->msg( 'api-help-title' ) );
@@ -559,11 +559,9 @@ class ApiHelp extends ApiBase {
                                                                                $arr = &$submodules;
                                                                                try {
                                                                                        $submod = $module->getModuleFromPath( $m );
-                                                                                       if ( $submod ) {
-                                                                                               if ( $submod->isDeprecated() ) {
-                                                                                                       $arr = &$deprecatedSubmodules;
-                                                                                                       $attrs['class'] = 'apihelp-deprecated-value';
-                                                                                               }
+                                                                                       if ( $submod && $submod->isDeprecated() ) {
+                                                                                               $arr = &$deprecatedSubmodules;
+                                                                                               $attrs['class'] = 'apihelp-deprecated-value';
                                                                                        }
                                                                                } catch ( ApiUsageException $ex ) {
                                                                                        // Ignore