X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fskins%2FQuickTemplate.php;h=6686ae69c5bb4cbba87e9093e98627a65c91bbba;hb=689c847a32e7fe8a0b3a559a88a627a252c5018e;hp=e5d272c0cbb99b3052a5546aacc93bf706720f93;hpb=bdfe02223205923d923923dd420ba0dd863cd0fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/skins/QuickTemplate.php b/includes/skins/QuickTemplate.php index e5d272c0cb..19b41ba969 100644 --- a/includes/skins/QuickTemplate.php +++ b/includes/skins/QuickTemplate.php @@ -17,6 +17,7 @@ * * @file */ +use MediaWiki\MediaWikiServices; /** * Generic wrapper for template functions, with interface @@ -25,6 +26,16 @@ */ abstract class QuickTemplate { + /** + * @var array + */ + public $data; + + /** + * @var MediaWikiI18N + */ + public $translator; + /** @var Config $config */ protected $config; @@ -36,7 +47,7 @@ abstract class QuickTemplate { $this->translator = new MediaWikiI18N(); if ( $config === null ) { wfDebug( __METHOD__ . ' was called with no Config instance passed to it' ); - $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); + $config = MediaWikiServices::getInstance()->getMainConfig(); } $this->config = $config; } @@ -51,11 +62,11 @@ abstract class QuickTemplate { } /** - * extends the value of data with name $name with the value $value - * @since 1.25 - * @param string $name - * @param mixed $value - */ + * extends the value of data with name $name with the value $value + * @since 1.25 + * @param string $name + * @param mixed $value + */ public function extend( $name, $value ) { if ( $this->haveData( $name ) ) { $this->data[$name] = $this->data[$name] . $value; @@ -80,15 +91,19 @@ abstract class QuickTemplate { } /** + * @deprecated since 1.31 This function is a now-redundant optimisation intended + * for very old versions of PHP. The use of references here makes the code + * more fragile and is incompatible with plans like T140664. Use set() instead. * @param string $name - * @param mixed $value + * @param mixed &$value */ public function setRef( $name, &$value ) { + wfDeprecated( __METHOD__, '1.31' ); $this->data[$name] =& $value; } /** - * @param MediaWikiI18N $t + * @param MediaWikiI18N &$t */ public function setTranslator( &$t ) { $this->translator = &$t;