Pmiazga has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/369645 )
Change subject: Hygiene: Remove deprecation and unused import
......................................................................
Hygiene: Remove deprecation and unused import
Changes:
- ApiBase::setWarning() is deprecated, use addWarning() instead
- ParserCache::singleton() is deprecated, use MediaWikiServices instead
- Exception import is not used, drop it
Change-Id: Ib81e5acbb28e1f803c7a792b9f990f2aa6d57521
---
M includes/ApiQueryExtracts.php
M includes/ExtractFormatter.php
2 files changed, 3 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TextExtracts
refs/changes/45/369645/1
diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php
index e760db4..7d5241c 100644
--- a/includes/ApiQueryExtracts.php
+++ b/includes/ApiQueryExtracts.php
@@ -26,7 +26,6 @@
use FauxRequest;
use MediaWiki\MediaWikiServices;
use MWTidy;
-use ParserCache;
use ParserOptions;
use Title;
use ApiUsageException;
@@ -80,7 +79,7 @@
if ( is_callable( [ $this, 'addWarning' ] ) ) {
$this->addWarning( [
'apiwarn-textextracts-limit', $limit ] );
} else {
- $this->setWarning( 'exlimit was too large for a
whole article extracts request, ' .
+ $this->addWarning( 'exlimit was too large for a
whole article extracts request, ' .
"lowered to $limit" );
}
}
@@ -143,7 +142,7 @@
$contentModel
] );
} else {
- $this->setWarning(
"{$title->getPrefixedDBkey()} has content model '$contentModel',"
+ $this->addWarning(
"{$title->getPrefixedDBkey()} has content model '$contentModel',"
. ' which is not supported; returning
an empty extract.' );
}
return '';
@@ -216,7 +215,7 @@
}
// first try finding full page in parser cache
if ( $page->shouldCheckParserCache( $this->parserOptions, 0 ) )
{
- $pout = ParserCache::singleton()->get( $page,
$this->parserOptions );
+ $pout =
MediaWikiServices::getInstance()->getParserCache()->get( $page,
$this->parserOptions );
if ( $pout ) {
$text = $pout->getText();
if ( $this->params['intro'] ) {
diff --git a/includes/ExtractFormatter.php b/includes/ExtractFormatter.php
index 4dd7e92..893db0e 100644
--- a/includes/ExtractFormatter.php
+++ b/includes/ExtractFormatter.php
@@ -5,7 +5,6 @@
use Config;
use DOMElement;
use HtmlFormatter\HtmlFormatter;
-use Exception;
/**
* Provides text-only or limited-HTML extracts of page HTML
--
To view, visit https://gerrit.wikimedia.org/r/369645
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib81e5acbb28e1f803c7a792b9f990f2aa6d57521
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: Pmiazga <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits