Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4117765
LimitOperationResult.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
LimitOperationResult.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment