Code Duplication    Length = 7-7 lines in 4 locations

src/NodeGenerator.php 2 locations

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

src/QueryBuilderGenerator.php 2 locations

@@ 118-124 (lines=7) @@
115
    private function appendChildrenToArrayNode(Expr $queryBuilder, Expr $expr, array $data)
116
    {
117
        foreach ($data as $value) {
118
            if ($value instanceof \stdClass) {
119
                $argument = $this->createObjectNode($queryBuilder);
120
            } elseif (is_array($value)) {
121
                $argument = $this->createArrayNode($queryBuilder);
122
            } else {
123
                $argument = $this->createScalarNode($queryBuilder, $value);
124
            }
125
126
            $methodName = $this->useMethodName ? 'addToArrayNode' : 'add';
127
@@ 149-155 (lines=7) @@
146
    private function appendChildrenToObjectNode(Expr $queryBuilder, Expr $expr, \stdClass $data)
147
    {
148
        foreach ($data as $key => $value) {
149
            if ($value instanceof \stdClass) {
150
                $argument = $this->createObjectNode($queryBuilder);
151
            } elseif (is_array($value)) {
152
                $argument = $this->createArrayNode($queryBuilder);
153
            } else {
154
                $argument = $this->createScalarNode($queryBuilder, $value);
155
            }
156
157
            $methodName = $this->useMethodName ? 'addToObjectNode' : 'add';
158