From: Kunal Mehta Date: Fri, 23 Jun 2017 19:23:55 +0000 (-0700) Subject: API: Fix capitalization of SpecialRecentChanges* classes X-Git-Tag: 1.31.0-rc.0~2907^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=6f9da771513cc2e0bf7e059fed30b636596ca6d5;p=lhc%2Fweb%2Fwiklou.git API: Fix capitalization of SpecialRecentChanges* classes And use the magic ::class instead of plain strings. Noticed by logging added for T166759. Change-Id: I7694c272c255b5b1f7455e55e70ecc240a4ba61c --- diff --git a/includes/api/ApiFeedRecentChanges.php b/includes/api/ApiFeedRecentChanges.php index 0b04c8cc92..2a80dd5354 100644 --- a/includes/api/ApiFeedRecentChanges.php +++ b/includes/api/ApiFeedRecentChanges.php @@ -63,8 +63,8 @@ class ApiFeedRecentChanges extends ApiBase { $feedFormat = $this->params['feedformat']; $specialClass = $this->params['target'] !== null - ? 'SpecialRecentchangeslinked' - : 'SpecialRecentchanges'; + ? SpecialRecentChangesLinked::class + : SpecialRecentChanges::class; $formatter = $this->getFeedObject( $feedFormat, $specialClass ); @@ -90,12 +90,12 @@ 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->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $this->params['target'] ) ] );