Code Duplication    Length = 21-24 lines in 2 locations

src/Connection.php 2 locations

@@ 128-151 (lines=24) @@
125
    /**
126
     * {@inheritdoc}
127
     */
128
    public function statement($query, $bindings = [])
129
    {
130
        return $this->run($query, $bindings, function ($query, $bindings) {
131
            if ($this->pretending()) {
132
                return true;
133
            }
134
135
            $query = $this->prepareBindingsInQuery($query);
136
            $options = [
137
                'query' => $query,
138
                'count' => true,
139
                'batchSize' => 1000,
140
                'sanitize'  => true,
141
            ];
142
143
            if (count($bindings) > 0) {
144
                $options['bindVars'] = $this->prepareBindings($bindings);
145
            }
146
147
            $statement = new Statement($this->getArangoClient(), $options);
148
149
            return $statement->execute();
150
        });
151
    }
152
153
    /**
154
     * {@inheritdoc}
@@ 156-176 (lines=21) @@
153
    /**
154
     * {@inheritdoc}
155
     */
156
    public function affectingStatement($query, $bindings = [])
157
    {
158
        return $this->run($query, $bindings, function ($query, $bindings) {
159
            $query = $this->prepareBindingsInQuery($query);
160
161
            $options = [
162
                'query' => $query,
163
                'count' => true,
164
                'batchSize' => 1000,
165
                'sanitize'  => true,
166
            ];
167
168
            if (count($bindings) > 0) {
169
                $options['bindVars'] = $this->prepareBindings($bindings);
170
            }
171
172
            $statement = new Statement($this->getArangoClient(), $options);
173
174
            return $statement->execute();
175
        });
176
    }
177
178
    /**
179
     * Get Arango.DB