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.
@@ 1797-1810 (lines=14) @@
1794
   *
1795
   * @return bool <p>Boolean true on success, false otherwise.</p>
1796
   */
1797
  public function rollback(): bool
1798
  {
1799
    if ($this->_in_transaction === false) {
1800
      $this->_debug->displayError('Error: mysql server is not in transaction!', false);
1801
1802
      return false;
1803
    }
1804
1805
    $return = \mysqli_rollback($this->link);
1806
    \mysqli_autocommit($this->link, true);
1807
    $this->_in_transaction = false;
1808
1809
    return $return;
1810
  }
1811
1812
  /**
1813
   * Try to secure a variable, so can you use it in sql-queries.