original_string: public function waitForEmail($timeout = 5)
      {
          $condition = function () {
              return !empty($this->fetchLastMessage());
          };
  
          $message = sprintf('Waited for %d secs but no email has arrived', $timeout);
  
          $this->wait($timeout)->until($condition, $message);
      }
code: public function waitForEmail($timeout = 5)
      {
          $condition = function () {
              return !empty($this->fetchLastMessage());
          };
  
          $message = sprintf('Waited for %d secs but no email has arrived', $timeout);
  
          $this->wait($timeout)->until($condition, $message);
      }
code_tokens: public function waitForEmail ( $ timeout = 5 ) { $ condition = function ( ) { return ! empty ( $ this -> fetchLastMessage ( ) ) ; } ; $ message = sprintf ( 'Waited for %d secs but no email has arrived' , $ timeout ) ; $ this -> wait ( $ timeout ) -> until ( $ condition , $ message ) ; }
docstring: Wait until an email to be received.
  
  @param int $timeout
  
  @throws \Exception
docstring_tokens: Wait until an email to be received .