Code Duplication    Length = 16-17 lines in 2 locations

src/voku/db/DB.php 2 locations

@@ 771-787 (lines=17) @@
768
769
      $doctrineWrappedConnection = $this->doctrine_connection->getWrappedConnection();
770
771
      if ($this->isDoctrineMySQLiConnection() === true) {
772
        /* @var $doctrineWrappedConnection \Doctrine\DBAL\Driver\Mysqli\MysqliConnection */
773
774
        $this->mysqli_link = $doctrineWrappedConnection->getWrappedResourceHandle();
775
776
        $this->connected = $this->doctrine_connection->isConnected();
777
778
        if (!$this->connected) {
779
          $error = 'Error connecting to mysql server: ' . $this->doctrine_connection->errorInfo();
780
          $this->debug->displayError($error, false);
781
          throw new DBConnectException($error, 101);
782
        }
783
784
        $this->set_charset($this->charset);
785
786
        return $this->isReady();
787
      }
788
789
      if ($this->isDoctrinePDOConnection() === true) {
790
@@ 789-804 (lines=16) @@
786
        return $this->isReady();
787
      }
788
789
      if ($this->isDoctrinePDOConnection() === true) {
790
791
        $this->mysqli_link = null;
792
793
        $this->connected = $this->doctrine_connection->isConnected();
794
795
        if (!$this->connected) {
796
          $error = 'Error connecting to mysql server: ' . $this->doctrine_connection->errorInfo();
797
          $this->debug->displayError($error, false);
798
          throw new DBConnectException($error, 101);
799
        }
800
801
        $this->set_charset($this->charset);
802
803
        return $this->isReady();
804
      }
805
    }
806
807
    $flags = null;