<?php
+
+use MediaWiki\Storage\RevisionRecord;
+
/**
* Helper class for category membership changes
*
* @since 1.27
*/
-use Wikimedia\Assert\Assert;
-
class CategoryMembershipChange {
const CATEGORY_ADDITION = 1;
*
* @throws MWException
*/
- public function overrideNewForCategorizationCallback( $callback ) {
+ public function overrideNewForCategorizationCallback( callable $callback ) {
if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
throw new MWException( 'Cannot override newForCategorization callback in operation.' );
}
- Assert::parameterType( 'callable', $callback, '$callback' );
$this->newForCategorizationCallback = $callback;
}
$revision,
$added
) {
- $deleted = $revision ? $revision->getVisibility() & Revision::SUPPRESSED_USER : 0;
+ $deleted = $revision ? $revision->getVisibility() & RevisionRecord::SUPPRESSED_USER : 0;
$newRevId = $revision ? $revision->getId() : 0;
/**
*/
private function getUser() {
if ( $this->revision ) {
- $userId = $this->revision->getUser( Revision::RAW );
+ $userId = $this->revision->getUser( RevisionRecord::RAW );
if ( $userId === 0 ) {
- return User::newFromName( $this->revision->getUserText( Revision::RAW ), false );
+ return User::newFromName( $this->revision->getUserText( RevisionRecord::RAW ), false );
} else {
return User::newFromId( $userId );
}