* Get a Message object with its context set
*
* @param string $name Message name
+ * @param ... $params Message params
* @return Message
*/
- public function getMsg( $name ) {
- return $this->getSkin()->msg( $name );
+ public function getMsg( $name /* ... */ ) {
+ return call_user_func_array( [ $this->getSkin(), 'msg' ], func_get_args() );
}
function msg( $str ) {
$toolbox['info']['id'] = 't-info';
}
- Hooks::run( 'BaseTemplateToolbox', [ &$this, &$toolbox ] );
+ // Avoid PHP 7.1 warning from passing $this by reference
+ $template = $this;
+ Hooks::run( 'BaseTemplateToolbox', [ &$template, &$toolbox ] );
return $toolbox;
}
ob_start();
// We pass an extra 'true' at the end so extensions using BaseTemplateToolbox
// can abort and avoid outputting double toolbox links
- Hooks::run( 'SkinTemplateToolboxEnd', [ &$this, true ] );
+ // Avoid PHP 7.1 warning from passing $this by reference
+ $template = $this;
+ Hooks::run( 'SkinTemplateToolboxEnd', [ &$template, true ] );
$hookContents = ob_get_contents();
ob_end_clean();
if ( !trim( $hookContents ) ) {
if ( $content !== '' ) {
echo "<div class='after-portlet after-portlet-$name'>$content</div>";
}
-
}
/**