Code Duplication    Length = 14-14 lines in 2 locations

src/voku/db/DB.php 2 locations

@@ 672-685 (lines=14) @@
669
   *
670
   * @return bool <p>Boolean true on success, false otherwise.</p>
671
   */
672
  public function commit(): bool
673
  {
674
    if ($this->_in_transaction === false) {
675
      $this->_debug->displayError('Error: mysql server is not in transaction!', false);
676
677
      return false;
678
    }
679
680
    $return = \mysqli_commit($this->link);
681
    \mysqli_autocommit($this->link, true);
682
    $this->_in_transaction = false;
683
684
    return $return;
685
  }
686
687
  /**
688
   * Open a new connection to the MySQL server.
@@ 1794-1807 (lines=14) @@
1791
   *
1792
   * @return bool <p>Boolean true on success, false otherwise.</p>
1793
   */
1794
  public function rollback(): bool
1795
  {
1796
    if ($this->_in_transaction === false) {
1797
      $this->_debug->displayError('Error: mysql server is not in transaction!', false);
1798
1799
      return false;
1800
    }
1801
1802
    $return = \mysqli_rollback($this->link);
1803
    \mysqli_autocommit($this->link, true);
1804
    $this->_in_transaction = false;
1805
1806
    return $return;
1807
  }
1808
1809
  /**
1810
   * Try to secure a variable, so can you use it in sql-queries.