original_string: public static function get_most_recent_conversation_message(int $convid, int $currentuserid = 0) {
          global $USER;
  
          if (empty($currentuserid)) {
              $currentuserid = $USER->id;
          }
  
          if ($messages = helper::get_conversation_messages($currentuserid, $convid, 0, 0, 1, 'timecreated DESC')) {
              $convmessages = helper::format_conversation_messages($currentuserid, $convid, $messages);
              return array_pop($convmessages['messages']);
          }
  
          return null;
      }
code: public static function get_most_recent_conversation_message(int $convid, int $currentuserid = 0) {
          global $USER;
  
          if (empty($currentuserid)) {
              $currentuserid = $USER->id;
          }
  
          if ($messages = helper::get_conversation_messages($currentuserid, $convid, 0, 0, 1, 'timecreated DESC')) {
              $convmessages = helper::format_conversation_messages($currentuserid, $convid, $messages);
              return array_pop($convmessages['messages']);
          }
  
          return null;
      }
code_tokens: public static function get_most_recent_conversation_message ( int $ convid , int $ currentuserid = 0 ) { global $ USER ; if ( empty ( $ currentuserid ) ) { $ currentuserid = $ USER -> id ; } if ( $ messages = helper :: get_conversation_messages ( $ currentuserid , $ convid , 0 , 0 , 1 , 'timecreated DESC' ) ) { $ convmessages = helper :: format_conversation_messages ( $ currentuserid , $ convid , $ messages ) ; return array_pop ( $ convmessages [ 'messages' ] ) ; } return null ; }
docstring: Returns the most recent message in a conversation.
  
  @param int $convid The conversation identifier.
  @param int $currentuserid The current user identifier.
  @return \stdClass|null The most recent message.
docstring_tokens: Returns the most recent message in a conversation .