original_string: public function fetchMessages()
      {
          $messages = $this->client->get("inboxes/{$this->config['inbox_id']}/messages")->getBody();
  
          if ($messages instanceof Stream) {
              $messages = $messages->getContents();
          }
  
          $messages = json_decode($messages, true);
  
          foreach ($messages as $key => $message) {
              $messages[$key] = new MailtrapMessage($message, $this->client);
          }
  
          return $messages;
      }
code: public function fetchMessages()
      {
          $messages = $this->client->get("inboxes/{$this->config['inbox_id']}/messages")->getBody();
  
          if ($messages instanceof Stream) {
              $messages = $messages->getContents();
          }
  
          $messages = json_decode($messages, true);
  
          foreach ($messages as $key => $message) {
              $messages[$key] = new MailtrapMessage($message, $this->client);
          }
  
          return $messages;
      }
code_tokens: public function fetchMessages ( ) { $ messages = $ this -> client -> get ( "inboxes/{$this->config['inbox_id']}/messages" ) -> getBody ( ) ; if ( $ messages instanceof Stream ) { $ messages = $ messages -> getContents ( ) ; } $ messages = json_decode ( $ messages , true ) ; foreach ( $ messages as $ key => $ message ) { $ messages [ $ key ] = new MailtrapMessage ( $ message , $ this -> client ) ; } return $ messages ; }
docstring: Get the most recent message of the default inbox.
  
  @return array
docstring_tokens: Get the most recent message of the default inbox .