mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
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:
parent
58d531861c
commit
22925c5344
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue