Cast API timeSpentBackend to an int
[lhc/web/wiklou.git] / includes / api / ApiQueryInfo.php
index 6f1e2e5..2d382dd 100644 (file)
@@ -33,17 +33,25 @@ class ApiQueryInfo extends ApiQueryBase {
 
        private $fld_protection = false, $fld_talkid = false,
                $fld_subjectid = false, $fld_url = false,
-               $fld_readable = false, $fld_watched = false, $fld_watchers = false,
+               $fld_readable = false, $fld_watched = false,
+               $fld_watchers = false, $fld_visitingwatchers = false,
                $fld_notificationtimestamp = false,
                $fld_preload = false, $fld_displaytitle = false;
 
-       private $params, $titles, $missing, $everything;
+       private $params;
+
+       /** @var Title[] */
+       private $titles;
+       /** @var Title[] */
+       private $missing;
+       /** @var Title[] */
+       private $everything;
 
        private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched,
                $pageLatest, $pageLength;
 
-       private $protections, $restrictionTypes, $watched, $watchers, $notificationtimestamps,
-               $talkids, $subjectids, $displaytitles;
+       private $protections, $restrictionTypes, $watched, $watchers, $visitingwatchers,
+               $notificationtimestamps, $talkids, $subjectids, $displaytitles;
        private $showZeroWatchers = false;
 
        private $tokenFunctions;
@@ -93,32 +101,32 @@ class ApiQueryInfo extends ApiQueryBase {
                // If we're in a mode that breaks the same-origin policy, no tokens can
                // be obtained
                if ( $this->lacksSameOriginSecurity() ) {
-                       return array();
-               }
-
-               $this->tokenFunctions = array(
-                       'edit' => array( 'ApiQueryInfo', 'getEditToken' ),
-                       'delete' => array( 'ApiQueryInfo', 'getDeleteToken' ),
-                       'protect' => array( 'ApiQueryInfo', 'getProtectToken' ),
-                       'move' => array( 'ApiQueryInfo', 'getMoveToken' ),
-                       'block' => array( 'ApiQueryInfo', 'getBlockToken' ),
-                       'unblock' => array( 'ApiQueryInfo', 'getUnblockToken' ),
-                       'email' => array( 'ApiQueryInfo', 'getEmailToken' ),
-                       'import' => array( 'ApiQueryInfo', 'getImportToken' ),
-                       'watch' => array( 'ApiQueryInfo', 'getWatchToken' ),
-               );
-               Hooks::run( 'APIQueryInfoTokens', array( &$this->tokenFunctions ) );
+                       return [];
+               }
+
+               $this->tokenFunctions = [
+                       'edit' => [ 'ApiQueryInfo', 'getEditToken' ],
+                       'delete' => [ 'ApiQueryInfo', 'getDeleteToken' ],
+                       'protect' => [ 'ApiQueryInfo', 'getProtectToken' ],
+                       'move' => [ 'ApiQueryInfo', 'getMoveToken' ],
+                       'block' => [ 'ApiQueryInfo', 'getBlockToken' ],
+                       'unblock' => [ 'ApiQueryInfo', 'getUnblockToken' ],
+                       'email' => [ 'ApiQueryInfo', 'getEmailToken' ],
+                       'import' => [ 'ApiQueryInfo', 'getImportToken' ],
+                       'watch' => [ 'ApiQueryInfo', 'getWatchToken' ],
+               ];
+               Hooks::run( 'APIQueryInfoTokens', [ &$this->tokenFunctions ] );
 
                return $this->tokenFunctions;
        }
 
-       static protected $cachedTokens = array();
+       static protected $cachedTokens = [];
 
        /**
         * @deprecated since 1.24
         */
        public static function resetTokenCache() {
-               ApiQueryInfo::$cachedTokens = array();
+               ApiQueryInfo::$cachedTokens = [];
        }
 
        /**
@@ -292,6 +300,7 @@ class ApiQueryInfo extends ApiQueryBase {
                        $this->fld_protection = isset( $prop['protection'] );
                        $this->fld_watched = isset( $prop['watched'] );
                        $this->fld_watchers = isset( $prop['watchers'] );
+                       $this->fld_visitingwatchers = isset( $prop['visitingwatchers'] );
                        $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
                        $this->fld_talkid = isset( $prop['talkid'] );
                        $this->fld_subjectid = isset( $prop['subjectid'] );
@@ -307,7 +316,7 @@ class ApiQueryInfo extends ApiQueryBase {
                $this->everything = $this->titles + $this->missing;
                $result = $this->getResult();
 
-               uasort( $this->everything, array( 'Title', 'compare' ) );
+               uasort( $this->everything, [ 'Title', 'compare' ] );
                if ( !is_null( $this->params['continue'] ) ) {
                        // Throw away any titles we're gonna skip so they don't
                        // clutter queries
@@ -328,7 +337,7 @@ class ApiQueryInfo extends ApiQueryBase {
                // when resolving redirects, no page will have this field
                $this->pageIsRedir = !$pageSet->isResolvingRedirects()
                        ? $pageSet->getCustomField( 'page_is_redirect' )
-                       : array();
+                       : [];
                $this->pageIsNew = $pageSet->getCustomField( 'page_is_new' );
 
                $this->pageTouched = $pageSet->getCustomField( 'page_touched' );
@@ -348,6 +357,10 @@ class ApiQueryInfo extends ApiQueryBase {
                        $this->getWatcherInfo();
                }
 
+               if ( $this->fld_visitingwatchers ) {
+                       $this->getVisitingWatcherInfo();
+               }
+
                // Run the talkid/subjectid query if requested
                if ( $this->fld_talkid || $this->fld_subjectid ) {
                        $this->getTSIDs();
@@ -360,10 +373,10 @@ class ApiQueryInfo extends ApiQueryBase {
                /** @var $title Title */
                foreach ( $this->everything as $pageid => $title ) {
                        $pageInfo = $this->extractPageInfo( $pageid, $title );
-                       $fit = $pageInfo !== null && $result->addValue( array(
+                       $fit = $pageInfo !== null && $result->addValue( [
                                'query',
                                'pages'
-                       ), $pageid, $pageInfo );
+                       ], $pageid, $pageInfo );
                        if ( !$fit ) {
                                $this->setContinueEnumParameter( 'continue',
                                        $title->getNamespace() . '|' .
@@ -380,7 +393,7 @@ class ApiQueryInfo extends ApiQueryBase {
         * @return array|null
         */
        private function extractPageInfo( $pageid, $title ) {
-               $pageInfo = array();
+               $pageInfo = [];
                // $title->exists() needs pageid, which is not set for all title objects
                $titleExists = $pageid > 0;
                $ns = $title->getNamespace();
@@ -420,14 +433,14 @@ class ApiQueryInfo extends ApiQueryBase {
                }
 
                if ( $this->fld_protection ) {
-                       $pageInfo['protection'] = array();
+                       $pageInfo['protection'] = [];
                        if ( isset( $this->protections[$ns][$dbkey] ) ) {
                                $pageInfo['protection'] =
                                        $this->protections[$ns][$dbkey];
                        }
                        ApiResult::setIndexedTagName( $pageInfo['protection'], 'pr' );
 
-                       $pageInfo['restrictiontypes'] = array();
+                       $pageInfo['restrictiontypes'] = [];
                        if ( isset( $this->restrictionTypes[$ns][$dbkey] ) ) {
                                $pageInfo['restrictiontypes'] =
                                        $this->restrictionTypes[$ns][$dbkey];
@@ -440,13 +453,21 @@ class ApiQueryInfo extends ApiQueryBase {
                }
 
                if ( $this->fld_watchers ) {
-                       if ( isset( $this->watchers[$ns][$dbkey] ) ) {
+                       if ( $this->watchers !== null && $this->watchers[$ns][$dbkey] !== 0 ) {
                                $pageInfo['watchers'] = $this->watchers[$ns][$dbkey];
                        } elseif ( $this->showZeroWatchers ) {
                                $pageInfo['watchers'] = 0;
                        }
                }
 
+               if ( $this->fld_visitingwatchers ) {
+                       if ( $this->visitingwatchers !== null && $this->visitingwatchers[$ns][$dbkey] !== 0 ) {
+                               $pageInfo['visitingwatchers'] = $this->visitingwatchers[$ns][$dbkey];
+                       } elseif ( $this->showZeroWatchers ) {
+                               $pageInfo['visitingwatchers'] = 0;
+                       }
+               }
+
                if ( $this->fld_notificationtimestamp ) {
                        $pageInfo['notificationtimestamp'] = '';
                        if ( isset( $this->notificationtimestamps[$ns][$dbkey] ) ) {
@@ -477,7 +498,7 @@ class ApiQueryInfo extends ApiQueryBase {
                                $pageInfo['preload'] = '';
                        } else {
                                $text = null;
-                               Hooks::run( 'EditFormPreloadText', array( &$text, &$title ) );
+                               Hooks::run( 'EditFormPreloadText', [ &$text, &$title ] );
 
                                $pageInfo['preload'] = $text;
                        }
@@ -498,7 +519,7 @@ class ApiQueryInfo extends ApiQueryBase {
                        }
 
                        $user = $this->getUser();
-                       $pageInfo['actions'] = array();
+                       $pageInfo['actions'] = [];
                        foreach ( $this->params['testactions'] as $action ) {
                                $this->countTestedActions++;
                                $pageInfo['actions'][$action] = $title->userCan( $action, $user );
@@ -513,26 +534,26 @@ class ApiQueryInfo extends ApiQueryBase {
         */
        private function getProtectionInfo() {
                global $wgContLang;
-               $this->protections = array();
+               $this->protections = [];
                $db = $this->getDB();
 
                // Get normal protections for existing titles
                if ( count( $this->titles ) ) {
                        $this->resetQueryParams();
                        $this->addTables( 'page_restrictions' );
-                       $this->addFields( array( 'pr_page', 'pr_type', 'pr_level',
-                               'pr_expiry', 'pr_cascade' ) );
+                       $this->addFields( [ 'pr_page', 'pr_type', 'pr_level',
+                               'pr_expiry', 'pr_cascade' ] );
                        $this->addWhereFld( 'pr_page', array_keys( $this->titles ) );
 
                        $res = $this->select( __METHOD__ );
                        foreach ( $res as $row ) {
                                /** @var $title Title */
                                $title = $this->titles[$row->pr_page];
-                               $a = array(
+                               $a = [
                                        'type' => $row->pr_type,
                                        'level' => $row->pr_level,
                                        'expiry' => $wgContLang->formatExpiry( $row->pr_expiry, TS_ISO_8601 )
-                               );
+                               ];
                                if ( $row->pr_cascade ) {
                                        $a['cascade'] = true;
                                }
@@ -553,26 +574,26 @@ class ApiQueryInfo extends ApiQueryBase {
                                                        if ( $restriction == '' ) {
                                                                continue;
                                                        }
-                                                       $this->protections[$namespace][$dbKey][] = array(
+                                                       $this->protections[$namespace][$dbKey][] = [
                                                                'type' => 'edit',
                                                                'level' => $restriction,
                                                                'expiry' => 'infinity',
-                                                       );
-                                                       $this->protections[$namespace][$dbKey][] = array(
+                                                       ];
+                                                       $this->protections[$namespace][$dbKey][] = [
                                                                'type' => 'move',
                                                                'level' => $restriction,
                                                                'expiry' => 'infinity',
-                                                       );
+                                                       ];
                                                } else {
                                                        $restriction = trim( $temp[1] );
                                                        if ( $restriction == '' ) {
                                                                continue;
                                                        }
-                                                       $this->protections[$namespace][$dbKey][] = array(
+                                                       $this->protections[$namespace][$dbKey][] = [
                                                                'type' => $temp[0],
                                                                'level' => $restriction,
                                                                'expiry' => 'infinity',
-                                                       );
+                                                       ];
                                                }
                                        }
                                }
@@ -584,21 +605,21 @@ class ApiQueryInfo extends ApiQueryBase {
                        $this->resetQueryParams();
                        $lb = new LinkBatch( $this->missing );
                        $this->addTables( 'protected_titles' );
-                       $this->addFields( array( 'pt_title', 'pt_namespace', 'pt_create_perm', 'pt_expiry' ) );
+                       $this->addFields( [ 'pt_title', 'pt_namespace', 'pt_create_perm', 'pt_expiry' ] );
                        $this->addWhere( $lb->constructSet( 'pt', $db ) );
                        $res = $this->select( __METHOD__ );
                        foreach ( $res as $row ) {
-                               $this->protections[$row->pt_namespace][$row->pt_title][] = array(
+                               $this->protections[$row->pt_namespace][$row->pt_title][] = [
                                        'type' => 'create',
                                        'level' => $row->pt_create_perm,
                                        'expiry' => $wgContLang->formatExpiry( $row->pt_expiry, TS_ISO_8601 )
-                               );
+                               ];
                        }
                }
 
                // Separate good and missing titles into files and other pages
                // and populate $this->restrictionTypes
-               $images = $others = array();
+               $images = $others = [];
                foreach ( $this->everything as $title ) {
                        if ( $title->getNamespace() == NS_FILE ) {
                                $images[] = $title->getDBkey();
@@ -614,10 +635,10 @@ class ApiQueryInfo extends ApiQueryBase {
                        // Non-images: check templatelinks
                        $lb = new LinkBatch( $others );
                        $this->resetQueryParams();
-                       $this->addTables( array( 'page_restrictions', 'page', 'templatelinks' ) );
-                       $this->addFields( array( 'pr_type', 'pr_level', 'pr_expiry',
+                       $this->addTables( [ 'page_restrictions', 'page', 'templatelinks' ] );
+                       $this->addFields( [ 'pr_type', 'pr_level', 'pr_expiry',
                                'page_title', 'page_namespace',
-                               'tl_title', 'tl_namespace' ) );
+                               'tl_title', 'tl_namespace' ] );
                        $this->addWhere( $lb->constructSet( 'tl', $db ) );
                        $this->addWhere( 'pr_page = page_id' );
                        $this->addWhere( 'pr_page = tl_from' );
@@ -626,21 +647,21 @@ class ApiQueryInfo extends ApiQueryBase {
                        $res = $this->select( __METHOD__ );
                        foreach ( $res as $row ) {
                                $source = Title::makeTitle( $row->page_namespace, $row->page_title );
-                               $this->protections[$row->tl_namespace][$row->tl_title][] = array(
+                               $this->protections[$row->tl_namespace][$row->tl_title][] = [
                                        'type' => $row->pr_type,
                                        'level' => $row->pr_level,
                                        'expiry' => $wgContLang->formatExpiry( $row->pr_expiry, TS_ISO_8601 ),
                                        'source' => $source->getPrefixedText()
-                               );
+                               ];
                        }
                }
 
                if ( count( $images ) ) {
                        // Images: check imagelinks
                        $this->resetQueryParams();
-                       $this->addTables( array( 'page_restrictions', 'page', 'imagelinks' ) );
-                       $this->addFields( array( 'pr_type', 'pr_level', 'pr_expiry',
-                               'page_title', 'page_namespace', 'il_to' ) );
+                       $this->addTables( [ 'page_restrictions', 'page', 'imagelinks' ] );
+                       $this->addFields( [ 'pr_type', 'pr_level', 'pr_expiry',
+                               'page_title', 'page_namespace', 'il_to' ] );
                        $this->addWhere( 'pr_page = page_id' );
                        $this->addWhere( 'pr_page = il_from' );
                        $this->addWhereFld( 'pr_cascade', 1 );
@@ -649,12 +670,12 @@ class ApiQueryInfo extends ApiQueryBase {
                        $res = $this->select( __METHOD__ );
                        foreach ( $res as $row ) {
                                $source = Title::makeTitle( $row->page_namespace, $row->page_title );
-                               $this->protections[NS_FILE][$row->il_to][] = array(
+                               $this->protections[NS_FILE][$row->il_to][] = [
                                        'type' => $row->pr_type,
                                        'level' => $row->pr_level,
                                        'expiry' => $wgContLang->formatExpiry( $row->pr_expiry, TS_ISO_8601 ),
                                        'source' => $source->getPrefixedText()
-                               );
+                               ];
                        }
                }
        }
@@ -664,7 +685,7 @@ class ApiQueryInfo extends ApiQueryBase {
         * and put them in $talkids and $subjectids
         */
        private function getTSIDs() {
-               $getTitles = $this->talkids = $this->subjectids = array();
+               $getTitles = $this->talkids = $this->subjectids = [];
 
                /** @var $t Title */
                foreach ( $this->everything as $t ) {
@@ -687,7 +708,7 @@ class ApiQueryInfo extends ApiQueryBase {
                $lb = new LinkBatch( $getTitles );
                $this->resetQueryParams();
                $this->addTables( 'page' );
-               $this->addFields( array( 'page_title', 'page_namespace', 'page_id' ) );
+               $this->addFields( [ 'page_title', 'page_namespace', 'page_id' ] );
                $this->addWhere( $lb->constructSet( 'page', $db ) );
                $res = $this->select( __METHOD__ );
                foreach ( $res as $row ) {
@@ -702,7 +723,7 @@ class ApiQueryInfo extends ApiQueryBase {
        }
 
        private function getDisplayTitle() {
-               $this->displaytitles = array();
+               $this->displaytitles = [];
 
                $pageIds = array_keys( $this->titles );
 
@@ -712,7 +733,7 @@ class ApiQueryInfo extends ApiQueryBase {
 
                $this->resetQueryParams();
                $this->addTables( 'page_props' );
-               $this->addFields( array( 'pp_page', 'pp_value' ) );
+               $this->addFields( [ 'pp_page', 'pp_value' ] );
                $this->addWhereFld( 'pp_page', $pageIds );
                $this->addWhereFld( 'pp_propname', 'displaytitle' );
                $res = $this->select( __METHOD__ );
@@ -735,20 +756,20 @@ class ApiQueryInfo extends ApiQueryBase {
                        return;
                }
 
-               $this->watched = array();
-               $this->notificationtimestamps = array();
+               $this->watched = [];
+               $this->notificationtimestamps = [];
                $db = $this->getDB();
 
                $lb = new LinkBatch( $this->everything );
 
                $this->resetQueryParams();
-               $this->addTables( array( 'watchlist' ) );
-               $this->addFields( array( 'wl_title', 'wl_namespace' ) );
+               $this->addTables( [ 'watchlist' ] );
+               $this->addFields( [ 'wl_title', 'wl_namespace' ] );
                $this->addFieldsIf( 'wl_notificationtimestamp', $this->fld_notificationtimestamp );
-               $this->addWhere( array(
+               $this->addWhere( [
                        $lb->constructSet( 'wl', $db ),
                        'wl_user' => $user->getId()
-               ) );
+               ] );
 
                $res = $this->select( __METHOD__ );
 
@@ -778,40 +799,97 @@ class ApiQueryInfo extends ApiQueryBase {
                        return;
                }
 
-               $this->watchers = array();
                $this->showZeroWatchers = $canUnwatchedpages;
-               $db = $this->getDB();
 
-               $lb = new LinkBatch( $this->everything );
-
-               $this->resetQueryParams();
-               $this->addTables( array( 'watchlist' ) );
-               $this->addFields( array( 'wl_title', 'wl_namespace', 'count' => 'COUNT(*)' ) );
-               $this->addWhere( array(
-                       $lb->constructSet( 'wl', $db )
-               ) );
-               $this->addOption( 'GROUP BY', array( 'wl_namespace', 'wl_title' ) );
+               $countOptions = [];
                if ( !$canUnwatchedpages ) {
-                       $this->addOption( 'HAVING', "COUNT(*) >= $unwatchedPageThreshold" );
+                       $countOptions['minimumWatchers'] = $unwatchedPageThreshold;
                }
 
-               $res = $this->select( __METHOD__ );
+               $this->watchers = WatchedItemStore::getDefaultInstance()->countWatchersMultiple(
+                       $this->everything,
+                       $countOptions
+               );
+       }
 
-               foreach ( $res as $row ) {
-                       $this->watchers[$row->wl_namespace][$row->wl_title] = (int)$row->count;
+       /**
+        * Get the count of watchers who have visited recent edits and put it in
+        * $this->visitingwatchers
+        *
+        * Based on InfoAction::pageCounts
+        */
+       private function getVisitingWatcherInfo() {
+               $config = $this->getConfig();
+               $user = $this->getUser();
+               $db = $this->getDB();
+
+               $canUnwatchedpages = $user->isAllowed( 'unwatchedpages' );
+               $unwatchedPageThreshold = $this->getConfig()->get( 'UnwatchedPageThreshold' );
+               if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
+                       return;
                }
+
+               $this->showZeroWatchers = $canUnwatchedpages;
+
+               $titlesWithThresholds = [];
+               if ( $this->titles ) {
+                       $lb = new LinkBatch( $this->titles );
+
+                       // Fetch last edit timestamps for pages
+                       $this->resetQueryParams();
+                       $this->addTables( [ 'page', 'revision' ] );
+                       $this->addFields( [ 'page_namespace', 'page_title', 'rev_timestamp' ] );
+                       $this->addWhere( [
+                               'page_latest = rev_id',
+                               $lb->constructSet( 'page', $db ),
+                       ] );
+                       $this->addOption( 'GROUP BY', [ 'page_namespace', 'page_title' ] );
+                       $timestampRes = $this->select( __METHOD__ );
+
+                       $age = $config->get( 'WatchersMaxAge' );
+                       $timestamps = [];
+                       foreach ( $timestampRes as $row ) {
+                               $revTimestamp = wfTimestamp( TS_UNIX, (int)$row->rev_timestamp );
+                               $timestamps[$row->page_namespace][$row->page_title] = $revTimestamp - $age;
+                       }
+                       $titlesWithThresholds = array_map(
+                               function( LinkTarget $target ) use ( $timestamps ) {
+                                       return [
+                                               $target, $timestamps[$target->getNamespace()][$target->getDBkey()]
+                                       ];
+                               },
+                               $this->titles
+                       );
+               }
+
+               if ( $this->missing ) {
+                       $titlesWithThresholds = array_merge(
+                               $titlesWithThresholds,
+                               array_map(
+                                       function( LinkTarget $target ) {
+                                               return [ $target, null ];
+                                       },
+                                       $this->missing
+                               )
+                       );
+               }
+
+               $this->visitingwatchers = WatchedItemStore::getDefaultInstance()->countVisitingWatchersMultiple(
+                       $titlesWithThresholds,
+                       !$canUnwatchedpages ? $unwatchedPageThreshold : null
+               );
        }
 
        public function getCacheMode( $params ) {
                // Other props depend on something about the current user
-               $publicProps = array(
+               $publicProps = [
                        'protection',
                        'talkid',
                        'subjectid',
                        'url',
                        'preload',
                        'displaytitle',
-               );
+               ];
                if ( array_diff( (array)$params['prop'], $publicProps ) ) {
                        return 'private';
                }
@@ -829,14 +907,15 @@ class ApiQueryInfo extends ApiQueryBase {
        }
 
        public function getAllowedParams() {
-               return array(
-                       'prop' => array(
+               return [
+                       'prop' => [
                                ApiBase::PARAM_ISMULTI => true,
-                               ApiBase::PARAM_TYPE => array(
+                               ApiBase::PARAM_TYPE => [
                                        'protection',
                                        'talkid',
                                        'watched', # private
                                        'watchers', # private
+                                       'visitingwatchers', # private
                                        'notificationtimestamp', # private
                                        'subjectid',
                                        'url',
@@ -845,31 +924,31 @@ class ApiQueryInfo extends ApiQueryBase {
                                        'displaytitle',
                                        // If you add more properties here, please consider whether they
                                        // need to be added to getCacheMode()
-                               ),
-                               ApiBase::PARAM_HELP_MSG_PER_VALUE => array(),
-                       ),
-                       'testactions' => array(
+                               ],
+                               ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
+                       ],
+                       'testactions' => [
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_ISMULTI => true,
-                       ),
-                       'token' => array(
+                       ],
+                       'token' => [
                                ApiBase::PARAM_DEPRECATED => true,
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() )
-                       ),
-                       'continue' => array(
+                       ],
+                       'continue' => [
                                ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
-                       ),
-               );
+                       ],
+               ];
        }
 
        protected function getExamplesMessages() {
-               return array(
+               return [
                        'action=query&prop=info&titles=Main%20Page'
                                => 'apihelp-query+info-example-simple',
                        'action=query&prop=info&inprop=protection&titles=Main%20Page'
                                => 'apihelp-query+info-example-protection',
-               );
+               ];
        }
 
        public function getHelpUrls() {