Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1429652
AnyOf.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
AnyOf.php
View Options
<?php
namespace
Hamcrest\Core
;
/*
Copyright (c) 2009 hamcrest.org
*/
use
Hamcrest\Description
;
use
Hamcrest\Util
;
/**
* Calculates the logical disjunction of multiple matchers. Evaluation is
* shortcut, so subsequent matchers are not called if an earlier matcher
* returns <code>true</code>.
*/
class
AnyOf
extends
ShortcutCombination
{
public
function
__construct
(
array
$matchers
)
{
parent
::
__construct
(
$matchers
);
}
public
function
matches
(
$item
)
{
return
$this
->
matchesWithShortcut
(
$item
,
true
);
}
public
function
describeTo
(
Description
$description
)
{
$this
->
describeToWithOperator
(
$description
,
'or'
);
}
/**
* Evaluates to true if ANY of the passed in matchers evaluate to true.
*
* @factory ...
*/
public
static
function
anyOf
(
/* args... */
)
{
$args
=
func_get_args
();
return
new
self
(
Util
::
createMatcherArray
(
$args
));
}
/**
* Evaluates to false if ANY of the passed in matchers evaluate to true.
*
* @factory ...
*/
public
static
function
noneOf
(
/* args... */
)
{
$args
=
func_get_args
();
return
IsNot
::
not
(
new
self
(
Util
::
createMatcherArray
(
$args
))
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 17:52 (9 h, 2 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
80/2d/39b289ec77a727f50cc0aecf8cfd
Default Alt Text
AnyOf.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment