Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3942438
ArrayUtilities.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
622 B
Referenced Files
None
Subscribers
None
ArrayUtilities.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Keruald\OmniTools\Collections
;
use
Closure
;
class
ArrayUtilities
{
///
/// Methods to transform every member of an array
///
/**
* @return int[]
*/
public
static
function
toIntegers
(
array
$array
)
:
array
{
$newArray
=
$array
;
array_walk
(
$newArray
,
self
::
toIntegerCallback
());
return
$newArray
;
}
///
/// Helpers to get callbacks for array_walk methods
///
public
static
function
toIntegerCallback
()
:
Closure
{
return
function
(&
$item
)
{
$item
=
(
int
)
$item
;
};
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 26, 16:26 (8 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2315189
Default Alt Text
ArrayUtilities.php (622 B)
Attached To
Mode
rKOT Keruald OmniTools
Attached
Detach File
Event Timeline
Log In to Comment