Code Duplication    Length = 16-17 lines in 2 locations

src/voku/db/DB.php 2 locations

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