Code Duplication    Length = 7-7 lines in 4 locations

src/Generator/QueryBuilderGenerator.php 2 locations

@@ 113-119 (lines=7) @@
110
    private function appendChildrenToArrayNode(Expr $queryBuilder, Expr $expr, array $data)
111
    {
112
        foreach ($data as $value) {
113
            if ($value instanceof \stdClass) {
114
                $argument = $this->createObjectNode($queryBuilder);
115
            } elseif (is_array($value)) {
116
                $argument = $this->createArrayNode($queryBuilder);
117
            } else {
118
                $argument = $this->createScalarNode($queryBuilder, $value);
119
            }
120
121
            $expr = new MethodCall($expr, 'addToArrayNode', [new Arg($argument)]);
122
@@ 142-148 (lines=7) @@
139
    private function appendChildrenToObjectNode(Expr $queryBuilder, Expr $expr, \stdClass $data)
140
    {
141
        foreach ($data as $key => $value) {
142
            if ($value instanceof \stdClass) {
143
                $argument = $this->createObjectNode($queryBuilder);
144
            } elseif (is_array($value)) {
145
                $argument = $this->createArrayNode($queryBuilder);
146
            } else {
147
                $argument = $this->createScalarNode($queryBuilder, $value);
148
            }
149
150
            $expr = new MethodCall($expr, 'addToObjectNode', [new Arg(new String_($key)), new Arg($argument)]);
151

src/Generator/NodeGenerator.php 2 locations

@@ 103-109 (lines=7) @@
100
        $expr = $this->createArrayNode();
101
102
        foreach ($data as $key => $value) {
103
            if ($value instanceof \stdClass) {
104
                $nodeExpr = $this->createObjectNode();
105
            } elseif (is_array($value)) {
106
                $nodeExpr = $this->createArrayNode();
107
            } else {
108
                $nodeExpr = $this->createScalarNode($value);
109
            }
110
111
            if ($value instanceof \stdClass) {
112
                $nodeExpr = $this->appendChildrenToObjectNode($value);
@@ 132-138 (lines=7) @@
129
        $expr = $this->createObjectNode();
130
131
        foreach ($data as $key => $value) {
132
            if ($value instanceof \stdClass) {
133
                $nodeExpr = $this->createObjectNode();
134
            } elseif (is_array($value)) {
135
                $nodeExpr = $this->createArrayNode();
136
            } else {
137
                $nodeExpr = $this->createScalarNode($value);
138
            }
139
140
            if ($value instanceof \stdClass) {
141
                $nodeExpr = $this->appendChildrenToObjectNode($value);