Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96073059
Set.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
Sun, Dec 22, 08:24
Size
532 B
Mime Type
text/x-php
Expires
Tue, Dec 24, 08:24 (2 d)
Engine
blob
Format
Raw Data
Handle
23113353
Attached To
rPH Phabricator
Set.php
View Options
<?php
class
Stripe_Util_Set
{
private
$_elts
;
public
function
__construct
(
$members
=
array
())
{
$this
->
_elts
=
array
();
foreach
(
$members
as
$item
)
$this
->
_elts
[
$item
]
=
true
;
}
public
function
includes
(
$elt
)
{
return
isset
(
$this
->
_elts
[
$elt
]);
}
public
function
add
(
$elt
)
{
$this
->
_elts
[
$elt
]
=
true
;
}
public
function
discard
(
$elt
)
{
unset
(
$this
->
_elts
[
$elt
]);
}
// TODO: make Set support foreach
public
function
toArray
()
{
return
array_keys
(
$this
->
_elts
);
}
}
Event Timeline
Log In to Comment