aboutsummaryrefslogtreecommitdiffstats
path: root/includes/content
diff options
context:
space:
mode:
authorDaimona Eaytoy <daimona.wiki@gmail.com>2024-01-28 22:41:46 +0100
committerDaimona Eaytoy <daimona.wiki@gmail.com>2024-01-28 22:41:46 +0100
commit4637824f688eb2cddacfa6318a3dc1d1ece3bef7 (patch)
treed358e7ed404870c89a625ca51f023ff0c44ce7cd /includes/content
parent8d637a128072246858cc6d6ca5c8225c062194e4 (diff)
downloadmediawikicore-4637824f688eb2cddacfa6318a3dc1d1ece3bef7.tar.gz
mediawikicore-4637824f688eb2cddacfa6318a3dc1d1ece3bef7.zip
Replace unchecked MWException with SPL exceptions
Bug: T328220 Change-Id: I4e0454ce3ad3741756e2010a76e548d6c9a6bcb5
Diffstat (limited to 'includes/content')
-rw-r--r--includes/content/WikitextContent.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php
index 458033ba9cec..41400c1ab9b8 100644
--- a/includes/content/WikitextContent.php
+++ b/includes/content/WikitextContent.php
@@ -74,10 +74,8 @@ class WikitextContent extends TextContent {
/**
* @param string|int|null|false $sectionId
- * @param Content $with
+ * @param Content $with New section content, must have the same content model as $this.
* @param string $sectionTitle
- *
- * @throws MWException
* @return Content
*
* @see Content::replaceSection()
@@ -88,7 +86,7 @@ class WikitextContent extends TextContent {
$sectionModelId = $with->getModel();
if ( $sectionModelId != $myModelId ) {
- throw new MWException( "Incompatible content model for section: " .
+ throw new InvalidArgumentException( "Incompatible content model for section: " .
"document uses $myModelId but " .
"section uses $sectionModelId." );
}