Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3281482
PhutilCallbackFilterIterator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
611 B
Referenced Files
None
Subscribers
None
PhutilCallbackFilterIterator.php
View Options
<?php
/**
* NOTE: This class has the same purpose as `CallbackFilterIterator` in PHP 5.4.
*/
final
class
PhutilCallbackFilterIterator
extends
FilterIterator
{
private
$callback
;
/**
* @param Iterator
* @param callable Signature: (mixed $current): bool.
*/
public
function
__construct
(
Iterator
$iterator
,
$callback
)
{
parent
::
__construct
(
$iterator
)
;
if
(
!
is_callable
(
$callback
)
)
{
throw
new
Exception
(
pht
(
'Callback must be callable.'
)
)
;
}
$this
->
callback
=
$callback
;
}
public
function
accept
(
)
{
return
call_user_func
(
$this
->
callback
,
$this
->
current
(
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Mar 23, 22:35 (4 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1202777
Default Alt Text
PhutilCallbackFilterIterator.php (611 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment