original_string: public static function count_contacts(int $userid) : int {
          global $DB;
  
          $sql = "SELECT COUNT(id)
                    FROM {message_contacts}
                   WHERE userid = ? OR contactid = ?";
          return $DB->count_records_sql($sql, [$userid, $userid]);
      }
code: public static function count_contacts(int $userid) : int {
          global $DB;
  
          $sql = "SELECT COUNT(id)
                    FROM {message_contacts}
                   WHERE userid = ? OR contactid = ?";
          return $DB->count_records_sql($sql, [$userid, $userid]);
      }
code_tokens: public static function count_contacts ( int $ userid ) : int { global $ DB ; $ sql = "SELECT COUNT(id)
                    FROM {message_contacts}
                   WHERE userid = ? OR contactid = ?" ; return $ DB -> count_records_sql ( $ sql , [ $ userid , $ userid ] ) ; }
docstring: Returns the contacts count.
  
  @param int $userid The user id
  @return array
docstring_tokens: Returns the contacts count .