aboutsummaryrefslogtreecommitdiffstats
path: root/includes/diff/TextDiffer
diff options
context:
space:
mode:
authorEbrahim Byagowi <ebrahim@gnu.org>2024-05-19 20:59:11 +0330
committerEbrahim Byagowi <ebrahim@gnu.org>2024-05-19 23:57:44 +0330
commitb5727d94b52a3da55453535347773e2ecebfc1a6 (patch)
tree0483275f6a6231d73539b3b7c7969f06d2404a2a /includes/diff/TextDiffer
parent36eef7f7d4102931120bffa254527889b130562a (diff)
downloadmediawikicore-b5727d94b52a3da55453535347773e2ecebfc1a6.tar.gz
mediawikicore-b5727d94b52a3da55453535347773e2ecebfc1a6.zip
Import InvalidArgumentException at top of the source
It was asked in a patch review to apply fully import InvalidArgumentException where possible. I was guessing some of my other already merged patches have but turned out such thing exists other places style so for the sake of consistency I've turned rest of inline import of the specific exception at top of the file. There are instances of source files that aren't in any namespace but have fully qualified import which this patch doesn't touch. Change-Id: I4071fc698b65746d9594cf4d5f45bae82843d436
Diffstat (limited to 'includes/diff/TextDiffer')
-rw-r--r--includes/diff/TextDiffer/BaseTextDiffer.php3
-rw-r--r--includes/diff/TextDiffer/ManifoldTextDiffer.php5
2 files changed, 5 insertions, 3 deletions
diff --git a/includes/diff/TextDiffer/BaseTextDiffer.php b/includes/diff/TextDiffer/BaseTextDiffer.php
index 715a9d63ad5f..44a103f68390 100644
--- a/includes/diff/TextDiffer/BaseTextDiffer.php
+++ b/includes/diff/TextDiffer/BaseTextDiffer.php
@@ -2,6 +2,7 @@
namespace MediaWiki\Diff\TextDiffer;
+use InvalidArgumentException;
use MediaWiki\Html\Html;
use MediaWiki\Output\OutputPage;
use MessageLocalizer;
@@ -61,7 +62,7 @@ abstract class BaseTextDiffer implements TextDiffer {
protected function validateFormats( $formats ) {
$badFormats = array_diff( $formats, $this->getFormats() );
if ( $badFormats ) {
- throw new \InvalidArgumentException( 'The requested format is not supported by this engine' );
+ throw new InvalidArgumentException( 'The requested format is not supported by this engine' );
}
}
diff --git a/includes/diff/TextDiffer/ManifoldTextDiffer.php b/includes/diff/TextDiffer/ManifoldTextDiffer.php
index f6ca51befd0c..00282b622f72 100644
--- a/includes/diff/TextDiffer/ManifoldTextDiffer.php
+++ b/includes/diff/TextDiffer/ManifoldTextDiffer.php
@@ -3,6 +3,7 @@
namespace MediaWiki\Diff\TextDiffer;
use DomainException;
+use InvalidArgumentException;
use Language;
use MediaWiki\Output\OutputPage;
use MessageLocalizer;
@@ -69,7 +70,7 @@ class ManifoldTextDiffer implements TextDiffer {
public function render( string $oldText, string $newText, string $format ): string {
if ( !in_array( $format, $this->getFormats(), true ) ) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'The requested format is not supported by this engine' );
}
$results = $this->renderBatch( $oldText, $newText, [ $format ] );
@@ -147,7 +148,7 @@ class ManifoldTextDiffer implements TextDiffer {
private function getDifferForFormat( $format ) {
$differs = $this->getDiffersByFormat();
if ( !isset( $differs[$format] ) ) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
"Unknown format \"$format\""
);
}