Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1433105
IsTraversableWithSize.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
923 B
Referenced Files
None
Subscribers
None
IsTraversableWithSize.php
View Options
<?php
namespace
Hamcrest\Collection
;
/*
Copyright (c) 2009 hamcrest.org
*/
use
Hamcrest\FeatureMatcher
;
use
Hamcrest\Matcher
;
use
Hamcrest\Util
;
/**
* Matches if traversable size satisfies a nested matcher.
*/
class
IsTraversableWithSize
extends
FeatureMatcher
{
public
function
__construct
(
Matcher
$sizeMatcher
)
{
parent
::
__construct
(
self
::
TYPE_OBJECT
,
'Traversable'
,
$sizeMatcher
,
'a traversable with size'
,
'traversable size'
);
}
protected
function
featureValueOf
(
$actual
)
{
$size
=
0
;
foreach
(
$actual
as
$value
)
{
$size
++;
}
return
$size
;
}
/**
* Does traversable size satisfy a given matcher?
*
* @factory
*/
public
static
function
traversableWithSize
(
$size
)
{
return
new
self
(
Util
::
wrapValueWithIsEqual
(
$size
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 22:39 (2 h, 49 s)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
26/52/3756e6644c3c409b70fe27025021
Default Alt Text
IsTraversableWithSize.php (923 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment