Code Duplication    Length = 6-6 lines in 3 locations

src/voku/db/Prepare.php 3 locations

@@ 229-234 (lines=6) @@
226
    if ($result === true) {
227
228
      // "INSERT" || "REPLACE"
229
      if (preg_match('/^\s*"?(INSERT|REPLACE)\s+/i', $this->_sql)) {
230
        $insert_id = (int)$this->insert_id;
231
        $this->_debug->logQuery($this->_sql_with_bound_parameters, $query_duration, $insert_id);
232
233
        return $insert_id;
234
      }
235
236
      // "UPDATE" || "DELETE"
237
      if (preg_match('/^\s*"?(UPDATE|DELETE)\s+/i', $this->_sql)) {
@@ 237-242 (lines=6) @@
234
      }
235
236
      // "UPDATE" || "DELETE"
237
      if (preg_match('/^\s*"?(UPDATE|DELETE)\s+/i', $this->_sql)) {
238
        $affected_rows = (int)$this->affected_rows;
239
        $this->_debug->logQuery($this->_sql_with_bound_parameters, $query_duration, $affected_rows);
240
241
        return $affected_rows;
242
      }
243
244
      // "SELECT"
245
      if (preg_match('/^\s*"?(SELECT)\s+/i', $this->_sql)) {
@@ 245-250 (lines=6) @@
242
      }
243
244
      // "SELECT"
245
      if (preg_match('/^\s*"?(SELECT)\s+/i', $this->_sql)) {
246
        $num_rows = (int)$this->num_rows;
247
        $this->_debug->logQuery($this->_sql_with_bound_parameters, $query_duration, $num_rows);
248
249
        return true;
250
      }
251
252
      // log the ? query
253
      $this->_debug->logQuery($this->_sql_with_bound_parameters, $query_duration, 0);