Code Duplication    Length = 15-15 lines in 2 locations

src/Database/CouchbaseConnection.php 2 locations

@@ 325-339 (lines=15) @@
322
    /**
323
     * {@inheritdoc}
324
     */
325
    public function affectingStatement($query, $bindings = [])
326
    {
327
        return $this->run($query, $bindings, function ($me, $query, $bindings) {
328
            if ($me->pretending()) {
329
                return 0;
330
            }
331
            $query = \CouchbaseN1qlQuery::fromString($query);
332
            $query->consistency($this->consistency);
333
            $query->namedParams(['parameters' => $bindings]);
334
            $result = $this->executeQuery($query);
335
            $this->metrics = (isset($result->metrics)) ? $result->metrics : [];
336
337
            return (isset($result->rows[0])) ? $result->rows[0] : false;
338
        });
339
    }
340
341
    /**
342
     * @param       $query
@@ 347-361 (lines=15) @@
344
     *
345
     * @return mixed
346
     */
347
    public function positionalStatement($query, array $bindings = [])
348
    {
349
        return $this->run($query, $bindings, function ($me, $query, $bindings) {
350
            if ($me->pretending()) {
351
                return 0;
352
            }
353
            $query = \CouchbaseN1qlQuery::fromString($query);
354
            $query->consistency($this->consistency);
355
            $query->positionalParams($bindings);
356
            $result = $this->executeQuery($query);
357
            $this->metrics = (isset($result->metrics)) ? $result->metrics : [];
358
359
            return (isset($result->rows[0])) ? $result->rows[0] : false;
360
        });
361
    }
362
363
    /**
364
     * {@inheritdoc}