Total Complexity | 5 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
13 | final class NodeObjectValue implements NodeValueInterface, ObjectValueInterface |
||
14 | { |
||
15 | |||
16 | private $data; |
||
17 | |||
18 | private $path; |
||
19 | |||
20 | private $valueFactory; |
||
21 | |||
22 | public function __construct( |
||
23 | stdClass $data, |
||
24 | PathInterface $path, |
||
25 | NodeValueFactoryInterface $valueFactory |
||
26 | ) { |
||
27 | $this->data = $data; |
||
28 | $this->path = $path; |
||
29 | $this->valueFactory = $valueFactory; |
||
30 | } |
||
31 | |||
32 | public function createChildIterator(): Iterator |
||
35 | } |
||
36 | |||
37 | private function createChildGenerator(): Generator |
||
38 | { |
||
39 | foreach (get_object_vars($this->data) as $name => $property) { |
||
40 | yield $name => $this |
||
41 | ->valueFactory |
||
42 | ->createValue($property, $this->path->copyWithProperty($name)); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | public function getPath(): PathInterface |
||
49 | } |
||
50 | } |
||
51 |