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