Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101862185
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, Feb 14, 12:18
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 16, 12:18 (2 d)
Engine
blob
Format
Raw Data
Handle
24191023
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