Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98146606
PhutilProxyIterator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 10, 07:09
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 12, 07:09 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23500030
Attached To
rPHU libphutil
PhutilProxyIterator.php
View Options
<?php
abstract
class
PhutilProxyIterator
extends
Phobject
implements
Iterator
{
private
$iterator
;
private
$key
;
private
$value
;
private
$valid
;
public
function
__construct
(
Iterator
$iterator
)
{
$this
->
iterator
=
$iterator
;
}
protected
function
didReadValue
(
$value
)
{
return
$value
;
}
/* -( Iterator Implementation )-------------------------------------------- */
final
public
function
rewind
()
{
$this
->
iterator
->
rewind
();
$this
->
update
();
}
final
public
function
valid
()
{
return
$this
->
valid
;
}
final
public
function
current
()
{
return
$this
->
value
;
}
final
public
function
key
()
{
return
$this
->
key
;
}
final
public
function
next
()
{
$this
->
iterator
->
next
();
$this
->
update
();
}
private
function
update
()
{
$this
->
key
=
$this
->
iterator
->
key
();
$this
->
valid
=
$this
->
iterator
->
valid
();
if
(
$this
->
valid
)
{
$value
=
$this
->
iterator
->
current
();
$value
=
$this
->
didReadValue
(
$value
);
$this
->
value
=
$value
;
}
}
}
Event Timeline
Log In to Comment