Page MenuHomeWickedGov Phorge

LimitOperationResult.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

LimitOperationResult.php

<?php
namespace Wikimedia\WRStats;
/**
* Information about the result of a single item in a limit batch
*
* @since 1.39
*/
class LimitOperationResult {
/** @var LimitCondition */
public $condition;
/** @var int The previous metric value before the current action was executed */
public $prevTotal;
/** @var int The value the metric would have if the increment operation were allowed */
public $newTotal;
/**
* @internal
*
* @param LimitCondition $condition
* @param int $prevTotal
* @param int $newTotal
*/
public function __construct( LimitCondition $condition, $prevTotal, $newTotal ) {
$this->condition = $condition;
$this->prevTotal = $prevTotal;
$this->newTotal = $newTotal;
}
/**
* Whether the operation was/is allowed.
*
* @return bool
*/
public function isAllowed() {
return $this->newTotal <= $this->condition->limit;
}
/**
* Get a string representing the object, for testing or debugging
*
* @return string
*/
public function dump() {
return "LimitActionResult{{$this->newTotal}/{$this->condition->limit}}";
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Aug 19, 02:20 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8d/88/824f222da74e7f3d74ed29682920
Default Alt Text
LimitOperationResult.php (1 KB)

Event Timeline