original_string: public static function require_registration() {
          if ($registration = self::get_registration()) {
              return $registration;
          }
          if (has_capability('moodle/site:config', context_system::instance())) {
              throw new moodle_exception('registrationwarning', 'admin', new moodle_url('/admin/registration/index.php'));
          } else {
              throw new moodle_exception('registrationwarningcontactadmin', 'admin');
          }
      }
code: public static function require_registration() {
          if ($registration = self::get_registration()) {
              return $registration;
          }
          if (has_capability('moodle/site:config', context_system::instance())) {
              throw new moodle_exception('registrationwarning', 'admin', new moodle_url('/admin/registration/index.php'));
          } else {
              throw new moodle_exception('registrationwarningcontactadmin', 'admin');
          }
      }
code_tokens: public static function require_registration ( ) { if ( $ registration = self :: get_registration ( ) ) { return $ registration ; } if ( has_capability ( 'moodle/site:config' , context_system :: instance ( ) ) ) { throw new moodle_exception ( 'registrationwarning' , 'admin' , new moodle_url ( '/admin/registration/index.php' ) ) ; } else { throw new moodle_exception ( 'registrationwarningcontactadmin' , 'admin' ) ; } }
docstring: Same as get_registration except it throws exception if site not registered
  
  @return stdClass
  @throws \moodle_exception
docstring_tokens: Same as get_registration except it throws exception if site not registered