Code Duplication    Length = 16-17 lines in 2 locations

src/voku/db/DB.php 2 locations

@@ 747-763 (lines=17) @@
744
745
      $doctrineWrappedConnection = $this->doctrine_connection->getWrappedConnection();
746
747
      if ($this->isDoctrineMySQLiConnection() === true) {
748
        /* @var $doctrineWrappedConnection \Doctrine\DBAL\Driver\Mysqli\MysqliConnection */
749
750
        $this->mysqli_link = $doctrineWrappedConnection->getWrappedResourceHandle();
751
752
        $this->connected = $this->doctrine_connection->isConnected();
753
754
        if (!$this->connected) {
755
          $error = 'Error connecting to mysql server: ' . $this->doctrine_connection->errorInfo();
756
          $this->debug->displayError($error, false);
757
          throw new DBConnectException($error, 101);
758
        }
759
760
        $this->set_charset($this->charset);
761
762
        return $this->isReady();
763
      }
764
765
      if ($this->isDoctrinePDOConnection() === true) {
766
@@ 765-780 (lines=16) @@
762
        return $this->isReady();
763
      }
764
765
      if ($this->isDoctrinePDOConnection() === true) {
766
767
        $this->mysqli_link = null;
768
769
        $this->connected = $this->doctrine_connection->isConnected();
770
771
        if (!$this->connected) {
772
          $error = 'Error connecting to mysql server: ' . $this->doctrine_connection->errorInfo();
773
          $this->debug->displayError($error, false);
774
          throw new DBConnectException($error, 101);
775
        }
776
777
        $this->set_charset($this->charset);
778
779
        return $this->isReady();
780
      }
781
    }
782
783
    $flags = null;