Code Duplication    Length = 12-14 lines in 2 locations

src/Connection.php 2 locations

@@ 241-252 (lines=12) @@
238
     * @param  array   $bindings
239
     * @return bool
240
     */
241
    public function statement($query, $bindings = [])
242
    {
243
        return $this->run($query, $bindings, function ($query, $bindings) {
244
            if ($this->pretending()) {
245
                return [];
246
            }
247
248
            $preparedStatement = $this->session->prepare($query);
249
250
            return $this->session->execute($preparedStatement, ['arguments' => $bindings]);
251
        });
252
    }
253
254
    /**
255
     * Because Cassandra is an eventually consistent database, it's not possible to obtain
@@ 263-276 (lines=14) @@
260
     * @param  array   $bindings
261
     * @return int
262
     */
263
    public function affectingStatement($query, $bindings = [])
264
    {
265
        return $this->run($query, $bindings, function ($query, $bindings) {
266
            if ($this->pretending()) {
267
                return 0;
268
            }
269
270
            $preparedStatement = $this->session->prepare($query);
271
272
            $this->session->execute($preparedStatement, ['arguments' => $bindings]);
273
274
            return 1;
275
        });
276
    }
277
278
    /**
279
     * @inheritdoc