Conditions | 5 |
Paths | 8 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 12 | ||
Bugs | 2 | Features | 1 |
1 | <?php |
||
37 | public function serialize() |
||
38 | { |
||
39 | $serialized = new \stdClass(); |
||
40 | foreach ($this->children as $name => $child) { |
||
41 | if (null !== $serializedChild = $child->serialize()) { |
||
42 | $serialized->$name = $serializedChild; |
||
43 | } elseif ($child->allowAddDefault()) { |
||
44 | $serialized->$name = $child->getAddDefault(); |
||
45 | } |
||
46 | } |
||
47 | |||
48 | if ([] === (array) $serialized) { |
||
49 | return; |
||
50 | } |
||
51 | |||
52 | return $serialized; |
||
53 | } |
||
54 | } |
||
55 |