MediaWiki
REL1_39
LimitOperationResult.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Wikimedia\WRStats
;
4
10
class
LimitOperationResult
{
12
public
$condition
;
13
15
public
$prevTotal
;
16
18
public
$newTotal
;
19
27
public
function
__construct
(
LimitCondition
$condition
,
$prevTotal
,
$newTotal
) {
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
}
Wikimedia\WRStats\LimitCondition
Definition
LimitCondition.php:9
Wikimedia\WRStats\LimitOperationResult
Information about the result of a single item in a limit batch.
Definition
LimitOperationResult.php:10
Wikimedia\WRStats\LimitOperationResult\dump
dump()
Get a string representing the object, for testing or debugging.
Definition
LimitOperationResult.php:47
Wikimedia\WRStats\LimitOperationResult\isAllowed
isAllowed()
Whether the operation was/is allowed.
Definition
LimitOperationResult.php:38
Wikimedia\WRStats\LimitOperationResult\$newTotal
int $newTotal
The value the metric would have if the increment operation were allowed.
Definition
LimitOperationResult.php:18
Wikimedia\WRStats\LimitOperationResult\$condition
LimitCondition $condition
Definition
LimitOperationResult.php:12
Wikimedia\WRStats\LimitOperationResult\__construct
__construct(LimitCondition $condition, $prevTotal, $newTotal)
Definition
LimitOperationResult.php:27
Wikimedia\WRStats\LimitOperationResult\$prevTotal
int $prevTotal
The previous metric value before the current action was executed.
Definition
LimitOperationResult.php:15
Wikimedia\WRStats
Definition
ArrayStatsStore.php:3
includes
libs
WRStats
LimitOperationResult.php
Generated on Mon Nov 25 2024 01:23:22 for MediaWiki by
1.10.0