content: Use Language::factory( 'en' ) instead of wfGetLangObj( 'en' )
authorFomafix <fomafix@googlemail.com>
Mon, 14 Dec 2015 17:34:10 +0000 (17:34 +0000)
committerKrinkle <krinklemail@gmail.com>
Fri, 18 Nov 2016 22:43:40 +0000 (22:43 +0000)
'en' is a static value so wfGetLangObj always calls Language::factory.

Change-Id: I22df4f7321ffa3e62a552bd2f449bf27feb5c042

includes/content/CodeContentHandler.php

index 20893bb..dfd46c8 100644 (file)
 abstract class CodeContentHandler extends TextContentHandler {
 
        /**
-        * Returns the english language, because code is english, and should be handled as such.
+        * Returns the English language, because code is English, and should be handled as such.
         *
         * @param Title $title
         * @param Content $content
         *
-        * @return Language Return of wfGetLangObj( 'en' )
+        * @return Language
         *
         * @see ContentHandler::getPageLanguage()
         */
        public function getPageLanguage( Title $title, Content $content = null ) {
-               return wfGetLangObj( 'en' );
+               return Language::factory( 'en' );
        }
 
        /**
-        * Returns the english language, because code is english, and should be handled as such.
+        * Returns the English language, because code is English, and should be handled as such.
         *
         * @param Title $title
         * @param Content $content
         *
-        * @return Language Return of wfGetLangObj( 'en' )
+        * @return Language
         *
         * @see ContentHandler::getPageViewLanguage()
         */
        public function getPageViewLanguage( Title $title, Content $content = null ) {
-               return wfGetLangObj( 'en' );
+               return Language::factory( 'en' );
        }
 
        /**