original_string: public static function get_matching_tours(\moodle_url $pageurl) {
          global $PAGE;
  
          $tours = cache::get_matching_tourdata($pageurl);
  
          foreach ($tours as $record) {
              $tour = tour::load_from_record($record);
              if ($tour->is_enabled() && $tour->matches_all_filters($PAGE->context)) {
                  return $tour;
              }
          }
  
          return null;
      }
code: public static function get_matching_tours(\moodle_url $pageurl) {
          global $PAGE;
  
          $tours = cache::get_matching_tourdata($pageurl);
  
          foreach ($tours as $record) {
              $tour = tour::load_from_record($record);
              if ($tour->is_enabled() && $tour->matches_all_filters($PAGE->context)) {
                  return $tour;
              }
          }
  
          return null;
      }
code_tokens: public static function get_matching_tours ( \ moodle_url $ pageurl ) { global $ PAGE ; $ tours = cache :: get_matching_tourdata ( $ pageurl ) ; foreach ( $ tours as $ record ) { $ tour = tour :: load_from_record ( $ record ) ; if ( $ tour -> is_enabled ( ) && $ tour -> matches_all_filters ( $ PAGE -> context ) ) { return $ tour ; } } return null ; }
docstring: Get the first tour matching the specified URL.
  
  @param   moodle_url  $pageurl        The URL to match.
  @return  tour
docstring_tokens: Get the first tour matching the specified URL .