original_string: final public static function engage_independent_stage($stage, $contextid) {
          if (!($stage & self::STAGE_CONFIRM + self::STAGE_DESTINATION)) {
              throw new restore_ui_exception('dependentstagerequested');
          }
          $class = 'restore_ui_stage_'.self::$stages[$stage];
          if (!class_exists($class)) {
              throw new restore_ui_exception('unknownuistage');
          }
          return new $class($contextid);
      }
code: final public static function engage_independent_stage($stage, $contextid) {
          if (!($stage & self::STAGE_CONFIRM + self::STAGE_DESTINATION)) {
              throw new restore_ui_exception('dependentstagerequested');
          }
          $class = 'restore_ui_stage_'.self::$stages[$stage];
          if (!class_exists($class)) {
              throw new restore_ui_exception('unknownuistage');
          }
          return new $class($contextid);
      }
code_tokens: final public static function engage_independent_stage ( $ stage , $ contextid ) { if ( ! ( $ stage & self :: STAGE_CONFIRM + self :: STAGE_DESTINATION ) ) { throw new restore_ui_exception ( 'dependentstagerequested' ) ; } $ class = 'restore_ui_stage_' . self :: $ stages [ $ stage ] ; if ( ! class_exists ( $ class ) ) { throw new restore_ui_exception ( 'unknownuistage' ) ; } return new $ class ( $ contextid ) ; }
docstring: Initialised the requested independent stage
  
  @throws restore_ui_exception
  @param int $stage One of self::STAGE_*
  @param int $contextid
  @return restore_ui_stage_confirm|restore_ui_stage_destination
docstring_tokens: Initialised the requested independent stage