Code Duplication    Length = 5-5 lines in 2 locations

src/NodeGenerator.php 2 locations

@@ 109-113 (lines=5) @@
106
                $nodeExpr = $this->createScalarNode($value);
107
            }
108
109
            if ($value instanceof \stdClass) {
110
                $nodeExpr = $this->appendChildrenToObjectNode($value);
111
            } elseif (is_array($value)) {
112
                $nodeExpr = $this->appendChildrenToArrayNode($value);
113
            }
114
115
            $expr = new MethodCall($expr, 'add', [new Arg($nodeExpr)]);
116
        }
@@ 138-142 (lines=5) @@
135
                $nodeExpr = $this->createScalarNode($value);
136
            }
137
138
            if ($value instanceof \stdClass) {
139
                $nodeExpr = $this->appendChildrenToObjectNode($value);
140
            } elseif (is_array($value)) {
141
                $nodeExpr = $this->appendChildrenToArrayNode($value);
142
            }
143
144
            $expr = new MethodCall($expr, 'add', [new Arg(new String_($key)), new Arg($nodeExpr)]);
145
        }