original_string: public static function get_default() {
          if ($visiblechildren = self::top()->get_children()) {
              $defcategory = reset($visiblechildren);
          } else {
              $toplevelcategories = self::get_tree(0);
              $defcategoryid = $toplevelcategories[0];
              $defcategory = self::get($defcategoryid, MUST_EXIST, true);
          }
          return $defcategory;
      }
code: public static function get_default() {
          if ($visiblechildren = self::top()->get_children()) {
              $defcategory = reset($visiblechildren);
          } else {
              $toplevelcategories = self::get_tree(0);
              $defcategoryid = $toplevelcategories[0];
              $defcategory = self::get($defcategoryid, MUST_EXIST, true);
          }
          return $defcategory;
      }
code_tokens: public static function get_default ( ) { if ( $ visiblechildren = self :: top ( ) -> get_children ( ) ) { $ defcategory = reset ( $ visiblechildren ) ; } else { $ toplevelcategories = self :: get_tree ( 0 ) ; $ defcategoryid = $ toplevelcategories [ 0 ] ; $ defcategory = self :: get ( $ defcategoryid , MUST_EXIST , true ) ; } return $ defcategory ; }
docstring: Returns the first found category
  
  Note that if there are no categories visible to the current user on the first level,
  the invisible category may be returned
  
  @return core_course_category
docstring_tokens: Returns the first found category