Merge "Improve return types in class MagicWordArray"
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index 49a6bb5..ab95b97 100644 (file)
@@ -103,6 +103,9 @@ class InfoAction extends FormlessAction {
                        }
                }
 
+               // "Help" button
+               $this->addHelpLink( 'Page information' );
+
                // Page header
                if ( !$this->msg( 'pageinfo-header' )->isDisabled() ) {
                        $content .= $this->msg( 'pageinfo-header' )->parse();
@@ -399,7 +402,7 @@ class InfoAction extends FormlessAction {
                }
 
                // Subpages of this page, if subpages are enabled for the current NS
-               if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {
+               if ( $services->getNamespaceInfo()->hasSubpages( $title->getNamespace() ) ) {
                        $prefixIndex = SpecialPage::getTitleFor(
                                'Prefixindex', $title->getPrefixedText() . '/' );
                        $pageInfo['header-basic'][] = [
@@ -730,12 +733,13 @@ class InfoAction extends FormlessAction {
        protected function pageCounts( Page $page ) {
                $fname = __METHOD__;
                $config = $this->context->getConfig();
-               $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+               $services = MediaWikiServices::getInstance();
+               $cache = $services->getMainWANObjectCache();
 
                return $cache->getWithSetCallback(
                        self::getCacheKey( $cache, $page->getTitle(), $page->getLatest() ),
                        WANObjectCache::TTL_WEEK,
-                       function ( $oldValue, &$ttl, &$setOpts ) use ( $page, $config, $fname ) {
+                       function ( $oldValue, &$ttl, &$setOpts ) use ( $page, $config, $fname, $services ) {
                                global $wgActorTableSchemaMigrationStage;
 
                                $title = $page->getTitle();
@@ -759,7 +763,7 @@ class InfoAction extends FormlessAction {
                                        $joins = [];
                                }
 
-                               $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();
+                               $watchedItemStore = $services->getWatchedItemStore();
 
                                $result = [];
                                $result['watchers'] = $watchedItemStore->countWatchers( $title );
@@ -824,7 +828,7 @@ class InfoAction extends FormlessAction {
                                );
 
                                // Subpages (if enabled)
-                               if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {
+                               if ( $services->getNamespaceInfo()->hasSubpages( $title->getNamespace() ) ) {
                                        $conds = [ 'page_namespace' => $title->getNamespace() ];
                                        $conds[] = 'page_title ' .
                                                $dbr->buildLike( $title->getDBkey() . '/', $dbr->anyString() );