aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2024-09-07 21:25:51 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2024-09-07 21:25:51 +0200
commit441017cb546f437117a24c9c9f0d24d312235501 (patch)
tree739beceec1e36eea644dbd98aa4c7d205ca583e2
parente659256efebe478fab1ce5d16b67faa2cccdf5d6 (diff)
downloadmediawikicore-441017cb546f437117a24c9c9f0d24d312235501.tar.gz
mediawikicore-441017cb546f437117a24c9c9f0d24d312235501.zip
ResourceLoader: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I90ecf85cb6f639af4be1947ccfbfb16d5b84cab3
-rw-r--r--includes/ResourceLoader/ImageModule.php4
-rw-r--r--includes/ResourceLoader/LessVarFileModule.php1
-rw-r--r--includes/ResourceLoader/OOUIModule.php3
-rw-r--r--includes/ResourceLoader/StartUpModule.php1
-rw-r--r--includes/ResourceLoader/UserModule.php1
-rw-r--r--includes/ResourceLoader/UserOptionsModule.php1
-rw-r--r--includes/ResourceLoader/UserStylesModule.php1
-rw-r--r--tests/phpunit/includes/ResourceLoader/WikiModuleTest.php1
8 files changed, 13 insertions, 0 deletions
diff --git a/includes/ResourceLoader/ImageModule.php b/includes/ResourceLoader/ImageModule.php
index 568ef474487d..db6fdb7bbee7 100644
--- a/includes/ResourceLoader/ImageModule.php
+++ b/includes/ResourceLoader/ImageModule.php
@@ -41,6 +41,7 @@ class ImageModule extends Module {
*/
protected $localBasePath = '';
+ /** @inheritDoc */
protected $origin = self::ORIGIN_CORE_SITEWIDE;
/** @var Image[][]|null */
@@ -49,6 +50,7 @@ class ImageModule extends Module {
protected $images = [];
/** @var string|null */
protected $defaultColor = null;
+ /** @var bool */
protected $useDataURI = true;
/** @var array|null */
protected $globalVariants = null;
@@ -56,7 +58,9 @@ class ImageModule extends Module {
protected $variants = [];
/** @var string|null */
protected $prefix = null;
+ /** @var string */
protected $selectorWithoutVariant = '.{prefix}-{name}';
+ /** @var string */
protected $selectorWithVariant = '.{prefix}-{name}-{variant}';
/**
diff --git a/includes/ResourceLoader/LessVarFileModule.php b/includes/ResourceLoader/LessVarFileModule.php
index 465fbd0a58b1..60bf67574207 100644
--- a/includes/ResourceLoader/LessVarFileModule.php
+++ b/includes/ResourceLoader/LessVarFileModule.php
@@ -31,6 +31,7 @@ use Wikimedia\Minify\CSSMin;
* @since 1.32
*/
class LessVarFileModule extends FileModule {
+ /** @var array */
protected $lessVariables = [];
/**
diff --git a/includes/ResourceLoader/OOUIModule.php b/includes/ResourceLoader/OOUIModule.php
index b6a123c427e1..9ffa5dd77fdd 100644
--- a/includes/ResourceLoader/OOUIModule.php
+++ b/includes/ResourceLoader/OOUIModule.php
@@ -30,8 +30,11 @@ use MediaWiki\Registration\ExtensionRegistry;
* @internal
*/
trait OOUIModule {
+ /** @var string[] */
protected static $knownScriptsModules = [ 'core' ];
+ /** @var string[] */
protected static $knownStylesModules = [ 'core', 'widgets', 'toolbars', 'windows' ];
+ /** @var string[] */
protected static $knownImagesModules = [
'indicators',
// Extra icons
diff --git a/includes/ResourceLoader/StartUpModule.php b/includes/ResourceLoader/StartUpModule.php
index aa9e9de5ea57..069fc314e4d4 100644
--- a/includes/ResourceLoader/StartUpModule.php
+++ b/includes/ResourceLoader/StartUpModule.php
@@ -50,6 +50,7 @@ class StartUpModule extends Module {
*/
private const STORAGE_VERSION = '2';
+ /** @var int[] */
private $groupIds = [
// These reserved numbers MUST start at 0 and not skip any. These are preset
// for forward compatibility so that they can be safely referenced by mediawiki.js,
diff --git a/includes/ResourceLoader/UserModule.php b/includes/ResourceLoader/UserModule.php
index 1bf3159f3f19..d1a79bb3f76a 100644
--- a/includes/ResourceLoader/UserModule.php
+++ b/includes/ResourceLoader/UserModule.php
@@ -33,6 +33,7 @@ use MediaWiki\Title\TitleValue;
* @internal
*/
class UserModule extends WikiModule {
+ /** @inheritDoc */
protected $origin = self::ORIGIN_USER_INDIVIDUAL;
/**
diff --git a/includes/ResourceLoader/UserOptionsModule.php b/includes/ResourceLoader/UserOptionsModule.php
index 0adbfb0116ba..383a9905e404 100644
--- a/includes/ResourceLoader/UserOptionsModule.php
+++ b/includes/ResourceLoader/UserOptionsModule.php
@@ -37,6 +37,7 @@ use MediaWiki\User\Options\UserOptionsLookup;
*/
class UserOptionsModule extends Module {
+ /** @inheritDoc */
protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
/**
diff --git a/includes/ResourceLoader/UserStylesModule.php b/includes/ResourceLoader/UserStylesModule.php
index ebd6dfa02258..e07072645daf 100644
--- a/includes/ResourceLoader/UserStylesModule.php
+++ b/includes/ResourceLoader/UserStylesModule.php
@@ -34,6 +34,7 @@ use MediaWiki\Title\TitleValue;
*/
class UserStylesModule extends WikiModule {
+ /** @inheritDoc */
protected $origin = self::ORIGIN_USER_INDIVIDUAL;
/**
diff --git a/tests/phpunit/includes/ResourceLoader/WikiModuleTest.php b/tests/phpunit/includes/ResourceLoader/WikiModuleTest.php
index bca80904d132..566954dd11f4 100644
--- a/tests/phpunit/includes/ResourceLoader/WikiModuleTest.php
+++ b/tests/phpunit/includes/ResourceLoader/WikiModuleTest.php
@@ -456,6 +456,7 @@ class WikiModuleTest extends ResourceLoaderTestCase {
}
class TestResourceLoaderWikiModule extends WikiModule {
+ /** @var array|null */
public static $returnFetchTitleInfo = null;
protected static function fetchTitleInfo( IReadableDatabase $db, array $pages, $fname = null ) {