Passed
Push — master ( a18919...9a039e )
by 世昌
01:53
created

RecursiveArrayDocAccess   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A offsetGet() 0 7 2
1
<?php
2
namespace nebula\arrayobject;
3
4
use nebula\arrayobject\ArrayDotAccess;
5
6
/**
7
 * 递归数组点获取类
8
 */
9
class RecursiveArrayDocAccess extends ArrayDotAccess
10
{
11
    public function offsetGet($offset)
12
    {
13
        $value = parent::offsetGet($offset);
14
        if (\is_array($value)) {
15
            return new self($value);
16
        }
17
        return $value;
18
    }
19
}
20