Replace usage of deprecated Page in favor of WikiPage/Article

Complete WikiPage/Article split and deprecate Page interface
Using actual WikiPage/Article contract

Bug: T239975
Change-Id: I343c3ca2e30715656950cab49c6470061c72b9a0
This commit is contained in:
ArtBaltai 2020-02-20 21:59:56 +03:00
parent 58d531861c
commit 22925c5344
2 changed files with 9 additions and 5 deletions

View file

@ -1572,12 +1572,17 @@ class AbuseFilter {
/**
* @deprecated Use VariableGenerator::addEditVars
* @param Title $title
* @param Page|null $page
* @param WikiPage|\Article|null $page
* @return AbuseFilterVariableHolder
*/
public static function getEditVars( Title $title, Page $page = null ) {
public static function getEditVars( Title $title, object $page = null ) {
if ( $page !== null && !$page instanceof WikiPage ) {
$page = $page->getPage();
}
$vars = new AbuseFilterVariableHolder();
$generator = new VariableGenerator( $vars );
return $generator->addEditVars( $title, $page )->getVariableHolder();
}

View file

@ -4,7 +4,6 @@ namespace MediaWiki\Extension\AbuseFilter\VariableGenerator;
use AbuseFilterVariableHolder;
use Hooks;
use Page;
use RCDatabaseLogEntry;
use Title;
use User;
@ -154,10 +153,10 @@ class VariableGenerator {
/**
* @param Title $title
* @param Page|null $page
* @param WikiPage|null $page
* @return $this For chaining
*/
public function addEditVars( Title $title, Page $page = null ) : self {
public function addEditVars( Title $title, WikiPage $page = null ) : self {
// NOTE: $page may end up remaining null, e.g. if $title points to a special page.
if ( !$page && $title->canExist() ) {
// TODO: The caller should do this!