Update docs and type hints
Change-Id: I6c513265d7e3136c43c160b86a83a921defaa3ec
This commit is contained in:
@@ -23,6 +23,9 @@
|
|||||||
* Resource loader module for providing MediaWiki language names.
|
* Resource loader module for providing MediaWiki language names.
|
||||||
*/
|
*/
|
||||||
class ResourceLoaderULSModule extends ResourceLoaderModule {
|
class ResourceLoaderULSModule extends ResourceLoaderModule {
|
||||||
|
/**
|
||||||
|
* @var Language
|
||||||
|
*/
|
||||||
protected $language;
|
protected $language;
|
||||||
protected $targets = array( 'desktop', 'mobile' );
|
protected $targets = array( 'desktop', 'mobile' );
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
class UniversalLanguageSelectorHooks {
|
class UniversalLanguageSelectorHooks {
|
||||||
/**
|
/**
|
||||||
* Whether ULS user toolbar (language selection and settings) is enabled.
|
* Whether ULS user toolbar (language selection and settings) is enabled.
|
||||||
|
*
|
||||||
|
* @param User $user
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function isToolbarEnabled( $user ) {
|
public static function isToolbarEnabled( $user ) {
|
||||||
@@ -35,8 +37,8 @@ class UniversalLanguageSelectorHooks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $out OutputPage
|
* @param OutputPage $out
|
||||||
* @param $skin Skin
|
* @param Skin $skin
|
||||||
* @return bool
|
* @return bool
|
||||||
* Hook: BeforePageDisplay
|
* Hook: BeforePageDisplay
|
||||||
*/
|
*/
|
||||||
@@ -64,7 +66,7 @@ class UniversalLanguageSelectorHooks {
|
|||||||
/**
|
/**
|
||||||
* @param $testModules array of javascript testing modules. 'qunit' is fed
|
* @param $testModules array of javascript testing modules. 'qunit' is fed
|
||||||
* using tests/qunit/QUnitTestResources.php.
|
* using tests/qunit/QUnitTestResources.php.
|
||||||
* @param $resourceLoader ResourceLoader
|
* @param ResourceLoader $resourceLoader
|
||||||
* @return bool
|
* @return bool
|
||||||
* Hook: ResourceLoaderTestModules
|
* Hook: ResourceLoaderTestModules
|
||||||
*/
|
*/
|
||||||
@@ -158,8 +160,9 @@ class UniversalLanguageSelectorHooks {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook to UserGetLanguageObject
|
* Hook to UserGetLanguageObject
|
||||||
* @param $user User
|
* @param User $user
|
||||||
* @param $code String
|
* @param string $code
|
||||||
|
* @param RequestContext $context Optional RequestContext
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function getLanguage( $user, &$code, $context = null ) {
|
public static function getLanguage( $user, &$code, $context = null ) {
|
||||||
@@ -239,7 +242,7 @@ class UniversalLanguageSelectorHooks {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook: ResourceLoaderGetConfigVars
|
* Hook: ResourceLoaderGetConfigVars
|
||||||
* @param $vars Array
|
* @param array $vars
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function addConfig( &$vars ) {
|
public static function addConfig( &$vars ) {
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ $wgExtensionFunctions[] = function() {
|
|||||||
|
|
||||||
if ( $wgULSGeoService === true ) {
|
if ( $wgULSGeoService === true ) {
|
||||||
$wgHooks['BeforePageDisplay'][] = function( &$out ) {
|
$wgHooks['BeforePageDisplay'][] = function( &$out ) {
|
||||||
|
/** @var OutputPage $out */
|
||||||
$out->addScript( '<script src="//bits.wikimedia.org/geoiplookup"></script>' );
|
$out->addScript( '<script src="//bits.wikimedia.org/geoiplookup"></script>' );
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user