Merge "Soft deprecate DeferredStringifier class"
[lhc/web/wiklou.git] / includes / api / ApiFeedRecentChanges.php
index 813ac01..e5dba8f 100644 (file)
@@ -47,24 +47,24 @@ class ApiFeedRecentChanges extends ApiBase {
                $this->params = $this->extractRequestParams();
 
                if ( !$config->get( 'Feed' ) ) {
-                       $this->dieUsage( 'Syndication feeds are not available', 'feed-unavailable' );
+                       $this->dieWithError( 'feed-unavailable' );
                }
 
                $feedClasses = $config->get( 'FeedClasses' );
                if ( !isset( $feedClasses[$this->params['feedformat']] ) ) {
-                       $this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' );
+                       $this->dieWithError( 'feed-invalid' );
                }
 
                $this->getMain()->setCacheMode( 'public' );
                if ( !$this->getMain()->getParameter( 'smaxage' ) ) {
-                       // bug 63249: This page gets hit a lot, cache at least 15 seconds.
+                       // T65249: This page gets hit a lot, cache at least 15 seconds.
                        $this->getMain()->setCacheMaxAge( 15 );
                }
 
                $feedFormat = $this->params['feedformat'];
                $specialClass = $this->params['target'] !== null
-                       ? 'SpecialRecentchangeslinked'
-                       : 'SpecialRecentchanges';
+                       ? SpecialRecentChangesLinked::class
+                       : SpecialRecentChanges::class;
 
                $formatter = $this->getFeedObject( $feedFormat, $specialClass );
 
@@ -90,15 +90,15 @@ class ApiFeedRecentChanges extends ApiBase {
         * Return a ChannelFeed object.
         *
         * @param string $feedFormat Feed's format (either 'rss' or 'atom')
-        * @param string $specialClass Relevant special page name (either 'SpecialRecentchanges' or
-        *     'SpecialRecentchangeslinked')
+        * @param string $specialClass Relevant special page name (either 'SpecialRecentChanges' or
+        *     'SpecialRecentChangesLinked')
         * @return ChannelFeed
         */
        public function getFeedObject( $feedFormat, $specialClass ) {
-               if ( $specialClass === 'SpecialRecentchangeslinked' ) {
+               if ( $specialClass === SpecialRecentChangesLinked::class ) {
                        $title = Title::newFromText( $this->params['target'] );
                        if ( !$title ) {
-                               $this->dieUsageMsg( [ 'invalidtitle', $this->params['target'] ] );
+                               $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $this->params['target'] ) ] );
                        }
 
                        $feed = new ChangesFeed( $feedFormat, false );
@@ -169,16 +169,6 @@ class ApiFeedRecentChanges extends ApiBase {
                        'showlinkedto' => false,
                ];
 
-               if ( $config->get( 'AllowCategorizedRecentChanges' ) ) {
-                       $ret += [
-                               'categories' => [
-                                       ApiBase::PARAM_TYPE => 'string',
-                                       ApiBase::PARAM_ISMULTI => true,
-                               ],
-                               'categories_any' => false,
-                       ];
-               }
-
                return $ret;
        }