It can be simplified as $this->wg->out->setHTMLTitle( $msg->title( $this->getContext()->getTitle() ) );