RecursiveArrayObject   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 14
ccs 0
cts 8
cp 0
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getArrayCopy() 0 12 3
1
<?php
2
3
/*
4
 * This file is part of PHP DNS Server.
5
 *
6
 * (c) Yif Swery <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace yswery\DNS\Config;
13
14
use ArrayObject;
15
16
class RecursiveArrayObject extends ArrayObject
17
{
18
    public function getArrayCopy()
19
    {
20
        $resultArray = parent::getArrayCopy();
21
        foreach ($resultArray as $key => $val) {
22
            if (!is_object($val)) {
23
                continue;
24
            }
25
            $o = new RecursiveArrayObject($val);
26
            $resultArray[$key] = $o->getArrayCopy();
27
        }
28
29
        return $resultArray;
30
    }
31
}
32