Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5972926
TimeBasedTerminationCondition.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
865 B
Referenced Files
None
Subscribers
None
TimeBasedTerminationCondition.php
View Options
<?php
namespace
Eris\Quantifier
;
use
Eris\Listener
;
use
Eris\Listener\EmptyListener
;
use
DateTime
;
use
DateInterval
;
class
TimeBasedTerminationCondition
extends
EmptyListener
implements
TerminationCondition
,
Listener
{
private
$limitTime
;
private
$time
;
private
$maximumInterval
;
public
function
__construct
(
callable
$time
,
DateInterval
$maximumInterval
)
{
$this
->
time
=
$time
;
$this
->
maximumInterval
=
$maximumInterval
;
}
public
function
startPropertyVerification
()
{
$this
->
limitTime
=
$this
->
currentDateTime
()
->
add
(
$this
->
maximumInterval
);
}
public
function
shouldTerminate
()
{
return
$this
->
currentDateTime
()
>=
$this
->
limitTime
;
}
private
function
currentDateTime
()
{
return
new
DateTime
(
"@"
.
call_user_func
(
$this
->
time
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 16:15 (1 d, 3 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
56/67/30a4aad748ed9050171d88eb4cb9
Default Alt Text
TimeBasedTerminationCondition.php (865 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment