Code Duplication    Length = 14-14 lines in 2 locations

src/voku/db/DB.php 2 locations

@@ 638-651 (lines=14) @@
635
   *
636
   * @return bool <p>Boolean true on success, false otherwise.</p>
637
   */
638
  public function commit(): bool
639
  {
640
    if ($this->_in_transaction === false) {
641
      $this->_debug->displayError('Error: mysql server is not in transaction!', false);
642
643
      return false;
644
    }
645
646
    $return = \mysqli_commit($this->link);
647
    \mysqli_autocommit($this->link, true);
648
    $this->_in_transaction = false;
649
650
    return $return;
651
  }
652
653
  /**
654
   * Open a new connection to the MySQL server.
@@ 1689-1702 (lines=14) @@
1686
   *
1687
   * @return bool <p>Boolean true on success, false otherwise.</p>
1688
   */
1689
  public function rollback(): bool
1690
  {
1691
    if ($this->_in_transaction === false) {
1692
      $this->_debug->displayError('Error: mysql server is not in transaction!', false);
1693
1694
      return false;
1695
    }
1696
1697
    $return = \mysqli_rollback($this->link);
1698
    \mysqli_autocommit($this->link, true);
1699
    $this->_in_transaction = false;
1700
1701
    return $return;
1702
  }
1703
1704
  /**
1705
   * Try to secure a variable, so can you use it in sql-queries.