* @param Config $config
*/
function __construct( Config $config = null ) {
- $this->data = array();
+ $this->data = [];
$this->translator = new MediaWikiI18N();
if ( $config === null ) {
wfDebug( __METHOD__ . ' was called with no Config instance passed to it' );
$this->data[$name] = $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;
+ } else {
+ $this->data[$name] = $value;
+ }
+ }
+
/**
* Gets the template data requested
* @since 1.22