* @author Daniel Friesen
* @file
*/
+use Liuggio\StatsdClient\Factory\StatsdDataFactory;
+use MediaWiki\MediaWikiServices;
/**
* An IContextSource implementation which will inherit context from another source
*/
private $config;
- /**
- * @var Stats
- */
- private $stats;
-
/**
* @var Timing
*/
private $timing;
/**
- * Constructor
* @param IContextSource $context Context to inherit from
*/
public function __construct( IContextSource $context ) {
/**
* Get the stats object
*
- * @return BufferingStatsdDataFactory
+ * @deprecated since 1.27 use a StatsdDataFactory from MediaWikiServices (preferably injected)
+ *
+ * @return IBufferingStatsdDataFactory
*/
public function getStats() {
- if ( !is_null( $this->stats ) ) {
- return $this->stats;
- } else {
- return $this->getContext()->getStats();
- }
+ return MediaWikiServices::getInstance()->getStatsdDataFactory();
}
/**
* it would set only the original context, and not take
* into account any changes.
*
+ * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
+ * or a MessageSpecifier.
* @param mixed $args,... Arguments to wfMessage
* @return Message
*/
- public function msg() {
+ public function msg( $key ) {
$args = func_get_args();
return call_user_func_array( 'wfMessage', $args )->setContext( $this );