MediaWiki master
UserEditCountInfo.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Deferred;
4
5use InvalidArgumentException;
7
14 private $user;
15
17 private $increment;
18
24 public function __construct( UserIdentity $user, int $increment ) {
25 $this->user = $user;
26 $this->increment = $increment;
27 }
28
34 public function merge( self $other ) {
35 if ( !$this->user->equals( $other->user ) ) {
36 throw new InvalidArgumentException( __METHOD__ . ': user does not match' );
37 }
38 $this->increment += $other->increment;
39 }
40
44 public function getUser() {
45 return $this->user;
46 }
47
51 public function getIncrement() {
52 return $this->increment;
53 }
54}
55
57class_alias( UserEditCountInfo::class, 'UserEditCountInfo' );
Helper class for UserEditCountUpdate.
__construct(UserIdentity $user, int $increment)
merge(self $other)
Merge another UserEditCountInfo into this one.
Interface for objects representing user identity.