Code Duplication    Length = 14-15 lines in 2 locations

src/Database/CouchbaseConnection.php 2 locations

@@ 200-213 (lines=14) @@
197
    /**
198
     * {@inheritdoc}
199
     */
200
    public function affectingStatement($query, $bindings = [])
201
    {
202
        return $this->run($query, $bindings, function ($me, $query, $bindings) {
203
            if ($me->pretending()) {
204
                return 0;
205
            }
206
            $query = \CouchbaseN1qlQuery::fromString($query);
207
            $query->consistency(\CouchbaseN1qlQuery::REQUEST_PLUS);
208
            $bucket = $this->openBucket($this->bucket);
209
            $result = $bucket->query($query, ['parameters' => $bindings]);
210
211
            return (isset($result[0])) ? $result[0] : false;
212
        });
213
    }
214
215
    /**
216
     * @param       $query
@@ 221-235 (lines=15) @@
218
     *
219
     * @return mixed
220
     */
221
    public function positionalStatement($query, array $bindings = [])
222
    {
223
        return $this->run($query, $bindings, function ($me, $query, $bindings) {
224
            if ($me->pretending()) {
225
                return 0;
226
            }
227
            $query = \CouchbaseN1qlQuery::fromString($query);
228
            $query->consistency(\CouchbaseN1qlQuery::REQUEST_PLUS);
229
            $query->options['args'] = $bindings;
230
            $bucket = $this->openBucket($this->bucket);
231
            $result = $bucket->query($query);
232
233
            return (isset($result[0])) ? $result[0] : false;
234
        });
235
    }
236
237
    /**
238
     * {@inheritdoc}