MediaWiki  master
StubUserLang.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\StubObject;
22 
23 use Language;
24 use RequestContext;
25 
29 class StubUserLang extends StubObject {
30 
31  public function __construct() {
32  parent::__construct( 'wgLang' );
33  }
34 
38  // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
39  public function _newObject() {
40  return RequestContext::getMain()->getLanguage();
41  }
42 }
43 
47 class_alias( StubUserLang::class, 'StubUserLang' );
Base class for language-specific code.
Definition: Language.php:61
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition: StubObject.php:55
Stub object for the user language.
Group all the pieces relevant to the context of a request into one instance.
static getMain()
Get the RequestContext object associated with the main request.