Page MenuHomeWickedGov Phorge

UserEditCountUpdateHookHandler.php
No OneTemporary

Size
783 B
Referenced Files
None
Subscribers
None

UserEditCountUpdateHookHandler.php

<?php
namespace MediaWiki\Extension\CentralAuth\Hooks\Handlers;
use MediaWiki\Extension\CentralAuth\CentralAuthEditCounter;
use MediaWiki\Extension\CentralAuth\User\CentralAuthUser;
use MediaWiki\Hook\UserEditCountUpdateHook;
class UserEditCountUpdateHookHandler implements UserEditCountUpdateHook {
private CentralAuthEditCounter $editCounter;
public function __construct( CentralAuthEditCounter $editCounter ) {
$this->editCounter = $editCounter;
}
/** @inheritDoc */
public function onUserEditCountUpdate( $infos ): void {
foreach ( $infos as $info ) {
$centralUser = CentralAuthUser::getInstanceByName( $info->getUser()->getName() );
if ( $centralUser->isAttached() ) {
$this->editCounter->increment( $centralUser, $info->getIncrement() );
}
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Aug 18, 15:44 (3 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
74/91/f8c7ba8da7d6a3f56bf07c0ed696
Default Alt Text
UserEditCountUpdateHookHandler.php (783 B)

Event Timeline