original_string: public function compareUserGroups(Userinfo $userinfo, $usergroups) {
  		if (!is_array($usergroups)) {
  			$usergroups = array($usergroups);
  		}
  		$correct = false;
  
  		$count = 0;
  		if (count($usergroups) == count($userinfo->groups)) {
  			foreach ($usergroups as $group) {
  				if (in_array($group, $userinfo->groups, true)) {
  					$count++;
  				}
  			}
  			if (count($userinfo->groups) == $count) {
  				$correct = true;
  			}
  		}
  
  		return $correct;
  	}
code: public function compareUserGroups(Userinfo $userinfo, $usergroups) {
  		if (!is_array($usergroups)) {
  			$usergroups = array($usergroups);
  		}
  		$correct = false;
  
  		$count = 0;
  		if (count($usergroups) == count($userinfo->groups)) {
  			foreach ($usergroups as $group) {
  				if (in_array($group, $userinfo->groups, true)) {
  					$count++;
  				}
  			}
  			if (count($userinfo->groups) == $count) {
  				$correct = true;
  			}
  		}
  
  		return $correct;
  	}
code_tokens: public function compareUserGroups ( Userinfo $ userinfo , $ usergroups ) { if ( ! is_array ( $ usergroups ) ) { $ usergroups = array ( $ usergroups ) ; } $ correct = false ; $ count = 0 ; if ( count ( $ usergroups ) == count ( $ userinfo -> groups ) ) { foreach ( $ usergroups as $ group ) { if ( in_array ( $ group , $ userinfo -> groups , true ) ) { $ count ++ ; } } if ( count ( $ userinfo -> groups ) == $ count ) { $ correct = true ; } } return $ correct ; }
docstring: compare set of usergroup with a user returns true if the usergroups are correct
  
  @param Userinfo $userinfo user with current usergroups
  @param array $usergroups array with the correct usergroups
  
  @return boolean
docstring_tokens: compare set of usergroup with a user returns true if the usergroups are correct