MediaWiki REL1_40
LimitOperationResult.php
Go to the documentation of this file.
1<?php
2
3namespace Wikimedia\WRStats;
4
12 public $condition;
13
15 public $prevTotal;
16
18 public $newTotal;
19
28 $this->condition = $condition;
29 $this->prevTotal = $prevTotal;
30 $this->newTotal = $newTotal;
31 }
32
38 public function isAllowed() {
39 return $this->newTotal <= $this->condition->limit;
40 }
41
47 public function dump() {
48 return "LimitActionResult{{$this->newTotal}/{$this->condition->limit}}";
49 }
50}
Information about the result of a single item in a limit batch.
dump()
Get a string representing the object, for testing or debugging.
isAllowed()
Whether the operation was/is allowed.
int $newTotal
The value the metric would have if the increment operation were allowed.
__construct(LimitCondition $condition, $prevTotal, $newTotal)
int $prevTotal
The previous metric value before the current action was executed.