original_string: public function connect()
      {
          if ($this->_mongo) {
              return $this->_mongo;
          }
  
          if ($this->logger() && $this->logQueries()) {
              $logger = $this->buildStreamContext();
          } else {
              $logger = [];
          }
  
          $this->_mongo = Monga::connection($this->dns(), $this->getMongoConfig(), $logger);
          $this->_connected = true;
          return $this->_mongo;
      }
code: public function connect()
      {
          if ($this->_mongo) {
              return $this->_mongo;
          }
  
          if ($this->logger() && $this->logQueries()) {
              $logger = $this->buildStreamContext();
          } else {
              $logger = [];
          }
  
          $this->_mongo = Monga::connection($this->dns(), $this->getMongoConfig(), $logger);
          $this->_connected = true;
          return $this->_mongo;
      }
code_tokens: public function connect ( ) { if ( $ this -> _mongo ) { return $ this -> _mongo ; } if ( $ this -> logger ( ) && $ this -> logQueries ( ) ) { $ logger = $ this -> buildStreamContext ( ) ; } else { $ logger = [ ] ; } $ this -> _mongo = Monga :: connection ( $ this -> dns ( ) , $ this -> getMongoConfig ( ) , $ logger ) ; $ this -> _connected = true ; return $ this -> _mongo ; }
docstring: Connects to our MongoDB instance and returns the connection object.  If we have connected previously, returns the
  old connection object that's already been established.
  
  @return Monga\Connection|null
docstring_tokens: Connects to our MongoDB instance and returns the connection object . If we have connected previously returns the old connection object that s already been established .