aboutsummaryrefslogtreecommitdiffstats
path: root/includes/content
diff options
context:
space:
mode:
authorthiemowmde <thiemo.kreuz@wikimedia.de>2023-07-20 15:20:21 +0200
committerKrinkle <krinkle@fastmail.com>2023-07-31 17:14:09 +0000
commitf549005179e71526a90a5ea2e2f8258f74018059 (patch)
treebb910a00729f5d26a6bdac485a868dfedb3b6689 /includes/content
parent175563ded4b381393bba354d8cebdb01c1af692b (diff)
downloadmediawikicore-f549005179e71526a90a5ea2e2f8258f74018059.tar.gz
mediawikicore-f549005179e71526a90a5ea2e2f8258f74018059.zip
content,maintenance: Use class-string<ClassName> in doc blocks
Start using `class-string<ClassName>` as a type hint in a few places where the information is really helpful. A lot of tools are able to understand this already. Change-Id: Ide45cae8c7875e664fab1155c6c720e515d8d811
Diffstat (limited to 'includes/content')
-rw-r--r--includes/content/CodeContentHandler.php6
-rw-r--r--includes/content/ContentHandler.php2
-rw-r--r--includes/content/CssContentHandler.php3
-rw-r--r--includes/content/JavaScriptContentHandler.php2
-rw-r--r--includes/content/JsonContentHandler.php2
-rw-r--r--includes/content/TextContentHandler.php2
-rw-r--r--includes/content/WikitextContentHandler.php3
7 files changed, 11 insertions, 9 deletions
diff --git a/includes/content/CodeContentHandler.php b/includes/content/CodeContentHandler.php
index fcbadeed0662..8c94d95a396e 100644
--- a/includes/content/CodeContentHandler.php
+++ b/includes/content/CodeContentHandler.php
@@ -65,11 +65,7 @@ abstract class CodeContentHandler extends TextContentHandler {
return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
}
- /**
- * @stable to override
- *
- * @return string
- */
+ /** @inheritDoc */
protected function getContentClass() {
throw new LogicException( 'Subclass must override' );
}
diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php
index 3d4b60fce347..c96c1f84a9af 100644
--- a/includes/content/ContentHandler.php
+++ b/includes/content/ContentHandler.php
@@ -842,7 +842,7 @@ abstract class ContentHandler {
* @stable to override
* @since 1.21
*
- * @return string
+ * @return class-string<DifferenceEngine>
*/
protected function getDiffEngineClass() {
return DifferenceEngine::class;
diff --git a/includes/content/CssContentHandler.php b/includes/content/CssContentHandler.php
index 9eda3282e094..ee112b28e75e 100644
--- a/includes/content/CssContentHandler.php
+++ b/includes/content/CssContentHandler.php
@@ -44,6 +44,9 @@ class CssContentHandler extends CodeContentHandler {
parent::__construct( $modelId, [ CONTENT_FORMAT_CSS ] );
}
+ /**
+ * @return class-string<CssContent>
+ */
protected function getContentClass() {
return CssContent::class;
}
diff --git a/includes/content/JavaScriptContentHandler.php b/includes/content/JavaScriptContentHandler.php
index 101ad43337a7..b498ed9331a0 100644
--- a/includes/content/JavaScriptContentHandler.php
+++ b/includes/content/JavaScriptContentHandler.php
@@ -43,7 +43,7 @@ class JavaScriptContentHandler extends CodeContentHandler {
}
/**
- * @return string
+ * @return class-string<JavaScriptContent>
*/
protected function getContentClass() {
return JavaScriptContent::class;
diff --git a/includes/content/JsonContentHandler.php b/includes/content/JsonContentHandler.php
index 4e166a3c76ef..6810b2702647 100644
--- a/includes/content/JsonContentHandler.php
+++ b/includes/content/JsonContentHandler.php
@@ -45,7 +45,7 @@ class JsonContentHandler extends CodeContentHandler {
}
/**
- * @return string
+ * @return class-string<JsonContent>
*/
protected function getContentClass() {
return JsonContent::class;
diff --git a/includes/content/TextContentHandler.php b/includes/content/TextContentHandler.php
index 875ca81834e7..37cbbb20e23a 100644
--- a/includes/content/TextContentHandler.php
+++ b/includes/content/TextContentHandler.php
@@ -103,7 +103,7 @@ class TextContentHandler extends ContentHandler {
*
* @since 1.24
*
- * @return string
+ * @return class-string<TextContent>
*/
protected function getContentClass() {
return TextContent::class;
diff --git a/includes/content/WikitextContentHandler.php b/includes/content/WikitextContentHandler.php
index b4c64b92f6f3..5d9d16959b69 100644
--- a/includes/content/WikitextContentHandler.php
+++ b/includes/content/WikitextContentHandler.php
@@ -88,6 +88,9 @@ class WikitextContentHandler extends TextContentHandler {
$this->parsoidParserFactory = $parsoidParserFactory;
}
+ /**
+ * @return class-string<WikitextContent>
+ */
protected function getContentClass() {
return WikitextContent::class;
}