original_string: public function ping()
      {
          try {
              $this->connect();
              $this->pdo->query('select 1')->fetchColumn();
          } catch (\PDOException $e) {
              if (strpos($e->getMessage(), 'server has gone away') !== false) {
                  return false;
              }
          }
  
          return true;
      }
code: public function ping()
      {
          try {
              $this->connect();
              $this->pdo->query('select 1')->fetchColumn();
          } catch (\PDOException $e) {
              if (strpos($e->getMessage(), 'server has gone away') !== false) {
                  return false;
              }
          }
  
          return true;
      }
code_tokens: public function ping ( ) { try { $ this -> connect ( ) ; $ this -> pdo -> query ( 'select 1' ) -> fetchColumn ( ) ; } catch ( \ PDOException $ e ) { if ( strpos ( $ e -> getMessage ( ) , 'server has gone away' ) !== false ) { return false ; } } return true ; }
docstring: Check whether the connection is available
  @return bool
  @throws \PDOException
  @throws \RuntimeException
docstring_tokens: Check whether the connection is available