original_string: protected function convert_autosaved_step_to_real_step() {
          if ($this->autosavedstep === null) {
              return;
          }
  
          $laststep = end($this->steps);
          if ($laststep !== $this->autosavedstep) {
              throw new coding_exception('Cannot convert autosaved step to real step, since other steps have been added.');
          }
  
          $this->observer->notify_step_modified($this->autosavedstep, $this, key($this->steps));
          $this->autosavedstep = null;
      }
code: protected function convert_autosaved_step_to_real_step() {
          if ($this->autosavedstep === null) {
              return;
          }
  
          $laststep = end($this->steps);
          if ($laststep !== $this->autosavedstep) {
              throw new coding_exception('Cannot convert autosaved step to real step, since other steps have been added.');
          }
  
          $this->observer->notify_step_modified($this->autosavedstep, $this, key($this->steps));
          $this->autosavedstep = null;
      }
code_tokens: protected function convert_autosaved_step_to_real_step ( ) { if ( $ this -> autosavedstep === null ) { return ; } $ laststep = end ( $ this -> steps ) ; if ( $ laststep !== $ this -> autosavedstep ) { throw new coding_exception ( 'Cannot convert autosaved step to real step, since other steps have been added.' ) ; } $ this -> observer -> notify_step_modified ( $ this -> autosavedstep , $ this , key ( $ this -> steps ) ) ; $ this -> autosavedstep = null ; }
docstring: If there is an autosaved step, convert it into a real save, so that it
  is preserved.
docstring_tokens: If there is an autosaved step convert it into a real save so that it is preserved .