Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7495171
ArrayObjectFilter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
720 B
Referenced Files
None
Subscribers
None
ArrayObjectFilter.php
View Options
<?php
namespace
DeepCopy\TypeFilter\Spl
;
use
DeepCopy\DeepCopy
;
use
DeepCopy\TypeFilter\TypeFilter
;
/**
* In PHP 7.4 the storage of an ArrayObject isn't returned as
* ReflectionProperty. So we deep copy its array copy.
*/
final
class
ArrayObjectFilter
implements
TypeFilter
{
/**
* @var DeepCopy
*/
private
$copier
;
public
function
__construct
(
DeepCopy
$copier
)
{
$this
->
copier
=
$copier
;
}
/**
* {@inheritdoc}
*/
public
function
apply
(
$arrayObject
)
{
$clone
=
clone
$arrayObject
;
foreach
(
$arrayObject
->
getArrayCopy
()
as
$k
=>
$v
)
{
$clone
->
offsetSet
(
$k
,
$this
->
copier
->
copy
(
$v
));
}
return
$clone
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 21:42 (6 d, 20 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ad/aa/f74bc446a0c26c4aebd242a895e0
Default Alt Text
ArrayObjectFilter.php (720 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment