Merge "RCFilters: Explicitly set the default highlight color to null"
[lhc/web/wiklou.git] / includes / skins / QuickTemplate.php
index 1886746..969ac51 100644 (file)
@@ -31,20 +31,14 @@ abstract class QuickTemplate {
         */
        public $data;
 
-       /**
-        * @var MediaWikiI18N
-        */
-       public $translator;
-
        /** @var Config $config */
        protected $config;
 
        /**
-        * @param Config $config
+        * @param Config|null $config
         */
        function __construct( Config $config = null ) {
                $this->data = [];
-               $this->translator = new MediaWikiI18N();
                if ( $config === null ) {
                        wfDebug( __METHOD__ . ' was called with no Config instance passed to it' );
                        $config = MediaWikiServices::getInstance()->getMainConfig();
@@ -79,15 +73,11 @@ abstract class QuickTemplate {
         * Gets the template data requested
         * @since 1.22
         * @param string $name Key for the data
-        * @param mixed $default Optional default (or null)
+        * @param mixed|null $default Optional default (or null)
         * @return mixed The value of the data requested or the deafult
         */
        public function get( $name, $default = null ) {
-               if ( isset( $this->data[$name] ) ) {
-                       return $this->data[$name];
-               } else {
-                       return $default;
-               }
+               return $this->data[$name] ?? $default;
        }
 
        /**
@@ -102,16 +92,6 @@ abstract class QuickTemplate {
                $this->data[$name] =& $value;
        }
 
-       /**
-        * @param MediaWikiI18N &$t
-        * @deprecate since 1.31 Use BaseTemplate::msg() or Skin::msg() instead for setting
-        *  message parameters.
-        */
-       public function setTranslator( &$t ) {
-               wfDeprecated( __METHOD__, '1.31' );
-               $this->translator = &$t;
-       }
-
        /**
         * Main function, used by classes that subclass QuickTemplate
         * to show the actual HTML output