original_string: public static function reset_tour($tourid, $context, $pageurl) {
          $params = self::validate_parameters(self::reset_tour_parameters(), [
                  'tourid'    => $tourid,
                  'context'   => $context,
                  'pageurl'   => $pageurl,
              ]);
  
          $context = \context_helper::instance_by_id($params['context']);
          self::validate_context($context);
  
          $tour = tourinstance::instance($params['tourid']);
          $tour->request_user_reset();
  
          $result = [];
  
          if ($tourinstance = \tool_usertours\manager::get_matching_tours(new \moodle_url($params['pageurl']))) {
              if ($tour->get_id() === $tourinstance->get_id()) {
                  $result['startTour'] = $tour->get_id();
  
                  \tool_usertours\event\tour_reset::create([
                      'contextid' => $context->id,
                      'objectid'  => $params['tourid'],
                      'other'     => [
                          'pageurl'   => $params['pageurl'],
                      ],
                  ])->trigger();
  
              }
          }
  
          return $result;
      }
code: public static function reset_tour($tourid, $context, $pageurl) {
          $params = self::validate_parameters(self::reset_tour_parameters(), [
                  'tourid'    => $tourid,
                  'context'   => $context,
                  'pageurl'   => $pageurl,
              ]);
  
          $context = \context_helper::instance_by_id($params['context']);
          self::validate_context($context);
  
          $tour = tourinstance::instance($params['tourid']);
          $tour->request_user_reset();
  
          $result = [];
  
          if ($tourinstance = \tool_usertours\manager::get_matching_tours(new \moodle_url($params['pageurl']))) {
              if ($tour->get_id() === $tourinstance->get_id()) {
                  $result['startTour'] = $tour->get_id();
  
                  \tool_usertours\event\tour_reset::create([
                      'contextid' => $context->id,
                      'objectid'  => $params['tourid'],
                      'other'     => [
                          'pageurl'   => $params['pageurl'],
                      ],
                  ])->trigger();
  
              }
          }
  
          return $result;
      }
code_tokens: public static function reset_tour ( $ tourid , $ context , $ pageurl ) { $ params = self :: validate_parameters ( self :: reset_tour_parameters ( ) , [ 'tourid' => $ tourid , 'context' => $ context , 'pageurl' => $ pageurl , ] ) ; $ context = \ context_helper :: instance_by_id ( $ params [ 'context' ] ) ; self :: validate_context ( $ context ) ; $ tour = tourinstance :: instance ( $ params [ 'tourid' ] ) ; $ tour -> request_user_reset ( ) ; $ result = [ ] ; if ( $ tourinstance = \ tool_usertours \ manager :: get_matching_tours ( new \ moodle_url ( $ params [ 'pageurl' ] ) ) ) { if ( $ tour -> get_id ( ) === $ tourinstance -> get_id ( ) ) { $ result [ 'startTour' ] = $ tour -> get_id ( ) ; \ tool_usertours \ event \ tour_reset :: create ( [ 'contextid' => $ context -> id , 'objectid' => $ params [ 'tourid' ] , 'other' => [ 'pageurl' => $ params [ 'pageurl' ] , ] , ] ) -> trigger ( ) ; } } return $ result ; }
docstring: Reset the specified tour for the current user.
  
  @param   int     $tourid     The ID of the tour.
  @param   int     $context    The Context ID of the current page.
  @param   string  $pageurl    The path of the current page requesting the reset.
  @return  array               As described in reset_tour_returns
docstring_tokens: Reset the specified tour for the current user .