Code Duplication    Length = 16-17 lines in 2 locations

src/voku/db/DB.php 2 locations

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