Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6050191
Evaluation.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
Evaluation.php
View Options
<?php
namespace
Eris\Quantifier
;
use
Eris\Generator\GeneratedValueSingle
;
use
PHPUnit\Framework\AssertionFailedError
;
/**
* TODO: change namespace. To what?
*/
final
class
Evaluation
{
private
$assertion
;
private
$onFailure
;
private
$onSuccess
;
private
$values
;
public
static
function
of
(
$assertion
)
{
return
new
self
(
$assertion
);
}
private
function
__construct
(
$assertion
)
{
$this
->
assertion
=
$assertion
;
$this
->
onFailure
=
function
()
{
};
$this
->
onSuccess
=
function
()
{
};
}
public
function
with
(
GeneratedValueSingle
$values
)
{
$this
->
values
=
$values
;
return
$this
;
}
public
function
onFailure
(
callable
$action
)
{
$this
->
onFailure
=
$action
;
return
$this
;
}
public
function
onSuccess
(
callable
$action
)
{
$this
->
onSuccess
=
$action
;
return
$this
;
}
public
function
execute
()
{
try
{
call_user_func_array
(
$this
->
assertion
,
$this
->
values
->
unbox
()
);
}
catch
(
AssertionFailedError
$e
)
{
call_user_func
(
$this
->
onFailure
,
$this
->
values
,
$e
);
return
;
}
call_user_func
(
$this
->
onSuccess
,
$this
->
values
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 22:59 (5 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f3/16/1910d4210000fe3fd2a2492c801b
Default Alt Text
Evaluation.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment