mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
ArticleRollbackComplete WikiPage typehint
Change-Id: Ie638e0b5346debe3e5aa3f8c8e75f15ed583103f
This commit is contained in:
parent
f9fa579a4b
commit
086d82a488
10
Hooks.php
10
Hooks.php
|
@ -1188,13 +1188,15 @@ class EchoHooks {
|
|||
/**
|
||||
* Handler for ArticleRollbackComplete hook.
|
||||
* @see http://www.mediawiki.org/wiki/Manual:Hooks/ArticleRollbackComplete
|
||||
* @param WikiPage $page The article that was edited
|
||||
*
|
||||
* @param WikiPage $wikiPage The article that was edited
|
||||
* @param User $agent The user who did the rollback
|
||||
* @param Revision $newRevision The revision the page was reverted back to
|
||||
* @param Revision $oldRevision The revision of the top edit that was reverted
|
||||
*
|
||||
* @return bool true in all cases
|
||||
*/
|
||||
public static function onRollbackComplete( $page, $agent, $newRevision, $oldRevision ) {
|
||||
public static function onRollbackComplete( WikiPage $wikiPage, $agent, $newRevision, $oldRevision ) {
|
||||
$victimId = $oldRevision->getUser();
|
||||
|
||||
if (
|
||||
|
@ -1203,9 +1205,9 @@ class EchoHooks {
|
|||
) {
|
||||
EchoEvent::create( [
|
||||
'type' => 'reverted',
|
||||
'title' => $page->getTitle(),
|
||||
'title' => $wikiPage->getTitle(),
|
||||
'extra' => [
|
||||
'revid' => $page->getRevision()->getId(),
|
||||
'revid' => $wikiPage->getRevision()->getId(),
|
||||
'reverted-user-id' => $victimId,
|
||||
'reverted-revision-id' => $oldRevision->getId(),
|
||||
'method' => 'rollback',
|
||||
|
|
Loading…
Reference in a new issue