X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontext%2FDerivativeContext.php;h=f7a1815d023e2f8c9c14ee32eccb3c02582d41cf;hb=21551d2d15f2262695ad9d56d38ae0af7d942ad9;hp=e77a058d1d8f9a1b011decbfcfd47ea321efef7f;hpb=61898ad28ed69c5b391eb43e0db9386279b9612c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index e77a058d1d..f7a1815d02 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -18,7 +18,6 @@ * @author Daniel Friesen * @file */ -use Liuggio\StatsdClient\Factory\StatsdDataFactory; use MediaWiki\MediaWikiServices; /** @@ -75,7 +74,6 @@ class DerivativeContext extends ContextSource implements MutableContext { private $timing; /** - * Constructor * @param IContextSource $context Context to inherit from */ public function __construct( IContextSource $context ) { @@ -83,17 +81,13 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the SiteConfiguration object - * - * @param Config $s + * @param Config $config */ - public function setConfig( Config $s ) { - $this->config = $s; + public function setConfig( Config $config ) { + $this->config = $config; } /** - * Get the Config object - * * @return Config */ public function getConfig() { @@ -105,19 +99,15 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Get the stats object - * * @deprecated since 1.27 use a StatsdDataFactory from MediaWikiServices (preferably injected) * - * @return StatsdDataFactory + * @return IBufferingStatsdDataFactory */ public function getStats() { return MediaWikiServices::getInstance()->getStatsdDataFactory(); } /** - * Get the timing object - * * @return Timing */ public function getTiming() { @@ -129,17 +119,13 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the WebRequest object - * - * @param WebRequest $r + * @param WebRequest $request */ - public function setRequest( WebRequest $r ) { - $this->request = $r; + public function setRequest( WebRequest $request ) { + $this->request = $request; } /** - * Get the WebRequest object - * * @return WebRequest */ public function getRequest() { @@ -151,17 +137,13 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the Title object - * - * @param Title $t + * @param Title $title */ - public function setTitle( Title $t ) { - $this->title = $t; + public function setTitle( Title $title ) { + $this->title = $title; } /** - * Get the Title object - * * @return Title|null */ public function getTitle() { @@ -191,13 +173,11 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the WikiPage object - * * @since 1.19 - * @param WikiPage $p + * @param WikiPage $wikiPage */ - public function setWikiPage( WikiPage $p ) { - $this->wikipage = $p; + public function setWikiPage( WikiPage $wikiPage ) { + $this->wikipage = $wikiPage; } /** @@ -218,17 +198,13 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the OutputPage object - * - * @param OutputPage $o + * @param OutputPage $output */ - public function setOutput( OutputPage $o ) { - $this->output = $o; + public function setOutput( OutputPage $output ) { + $this->output = $output; } /** - * Get the OutputPage object - * * @return OutputPage */ public function getOutput() { @@ -240,17 +216,13 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the User object - * - * @param User $u + * @param User $user */ - public function setUser( User $u ) { - $this->user = $u; + public function setUser( User $user ) { + $this->user = $user; } /** - * Get the User object - * * @return User */ public function getUser() { @@ -262,18 +234,16 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the Language object - * - * @param Language|string $l Language instance or language code + * @param Language|string $language Language instance or language code * @throws MWException * @since 1.19 */ - public function setLanguage( $l ) { - if ( $l instanceof Language ) { - $this->lang = $l; - } elseif ( is_string( $l ) ) { - $l = RequestContext::sanitizeLangCode( $l ); - $obj = Language::factory( $l ); + public function setLanguage( $language ) { + if ( $language instanceof Language ) { + $this->lang = $language; + } elseif ( is_string( $language ) ) { + $language = RequestContext::sanitizeLangCode( $language ); + $obj = Language::factory( $language ); $this->lang = $obj; } else { throw new MWException( __METHOD__ . " was passed an invalid type of data." ); @@ -281,8 +251,6 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Get the Language object - * * @return Language * @since 1.19 */ @@ -295,18 +263,14 @@ class DerivativeContext extends ContextSource implements MutableContext { } /** - * Set the Skin object - * - * @param Skin $s + * @param Skin $skin */ - public function setSkin( Skin $s ) { - $this->skin = clone $s; + public function setSkin( Skin $skin ) { + $this->skin = clone $skin; $this->skin->setContext( $this ); } /** - * Get the Skin object - * * @return Skin */ public function getSkin() { @@ -324,10 +288,12 @@ class DerivativeContext extends ContextSource implements MutableContext { * 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 );