Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12870357
OmniArray.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
987 B
Referenced Files
None
Subscribers
None
OmniArray.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Keruald\OmniTools\Collections
;
class
OmniArray
{
/**
* @var array
*/
private
$items
=
[];
///
/// Constructors
///
public
function
__construct
(?
iterable
$items
)
{
if
(
$items
===
null
)
{
return
;
}
if
(
is_array
(
$items
))
{
$this
->
items
=
$items
;
return
;
}
foreach
(
$items
as
$item
)
{
$this
->
items
[]
=
$item
;
}
}
public
static
function
explode
(
string
$delimiter
,
string
$string
,
int
$limit
=
PHP_INT_MAX
)
:
self
{
return
new
OmniArray
(
explode
(
$delimiter
,
$string
,
$limit
));
}
///
/// Transformation methods
///
public
function
toIntegers
()
:
self
{
array_walk
(
$this
->
items
,
ArrayUtilities
::
toIntegerCallback
());
return
$this
;
}
///
/// Getters methods
///
public
function
toArray
()
:
array
{
return
$this
->
items
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 17, 15:48 (21 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3144419
Default Alt Text
OmniArray.php (987 B)
Attached To
Mode
rKOT Keruald OmniTools
Attached
Detach File
Event Timeline
Log In to Comment