original_string: public function connect(): bool
      {
          try {
              $this->checkConnect();
              $this->log('Connect to ' . $this->connect['host']);
              $this->handler = new \PDO(
                  $this->connect['type'] . ':host=' . $this->connect['host'] . ';dbname=' . $this->connect['name'],
                  $this->connect['user'],
                  $this->connect['pass'],
                  $this->connect['options']
              );
  
              foreach ($this->attributes as $attribute => $value) {
                  $this->handler->setAttribute($attribute, $value);
              }
  
              $this->ok();
          } catch (\Exception $e) {
              throw new DbException("Attempt connection to database is failed: {$e->getMessage()}");
          }
          return true;
      }
code: public function connect(): bool
      {
          try {
              $this->checkConnect();
              $this->log('Connect to ' . $this->connect['host']);
              $this->handler = new \PDO(
                  $this->connect['type'] . ':host=' . $this->connect['host'] . ';dbname=' . $this->connect['name'],
                  $this->connect['user'],
                  $this->connect['pass'],
                  $this->connect['options']
              );
  
              foreach ($this->attributes as $attribute => $value) {
                  $this->handler->setAttribute($attribute, $value);
              }
  
              $this->ok();
          } catch (\Exception $e) {
              throw new DbException("Attempt connection to database is failed: {$e->getMessage()}");
          }
          return true;
      }
code_tokens: public function connect ( ) : bool { try { $ this -> checkConnect ( ) ; $ this -> log ( 'Connect to ' . $ this -> connect [ 'host' ] ) ; $ this -> handler = new \ PDO ( $ this -> connect [ 'type' ] . ':host=' . $ this -> connect [ 'host' ] . ';dbname=' . $ this -> connect [ 'name' ] , $ this -> connect [ 'user' ] , $ this -> connect [ 'pass' ] , $ this -> connect [ 'options' ] ) ; foreach ( $ this -> attributes as $ attribute => $ value ) { $ this -> handler -> setAttribute ( $ attribute , $ value ) ; } $ this -> ok ( ) ; } catch ( \ Exception $ e ) { throw new DbException ( "Attempt connection to database is failed: {$e->getMessage()}" ) ; } return true ; }
docstring: Connect to Db
  
  @return bool
  @throws DbException
docstring_tokens: Connect to Db