original_string: public function can_access_group(stdClass $user, int $groupid) : bool {
          if ($this->can_access_all_groups($user)) {
              // This user has access to all groups.
              return true;
          }
  
          // This is a group discussion for a forum in separate groups mode.
          // Check if the user is a member.
          // This is the most expensive check.
          return groups_is_member($groupid, $user->id);
      }
code: public function can_access_group(stdClass $user, int $groupid) : bool {
          if ($this->can_access_all_groups($user)) {
              // This user has access to all groups.
              return true;
          }
  
          // This is a group discussion for a forum in separate groups mode.
          // Check if the user is a member.
          // This is the most expensive check.
          return groups_is_member($groupid, $user->id);
      }
code_tokens: public function can_access_group ( stdClass $ user , int $ groupid ) : bool { if ( $ this -> can_access_all_groups ( $ user ) ) { // This user has access to all groups. return true ; } // This is a group discussion for a forum in separate groups mode. // Check if the user is a member. // This is the most expensive check. return groups_is_member ( $ groupid , $ user -> id ) ; }
docstring: Can the user access the given group?
  
  @param stdClass $user The user to check
  @param int $groupid The id of the group that the forum is set to
  @return bool
docstring_tokens: Can the user access the given group?