original_string: protected function _step($check = null)
      {
          $_steps = (array)$this->request->session()->read('Startup._steps');
          if ($check === null) {
              $_steps[] = $this->request->params['action'];
              $_steps = array_unique($_steps);
              $this->request->session()->write('Startup._steps', $_steps);
          } elseif (is_string($check)) {
              return in_array($check, $_steps);
          }
  
          return false;
      }
code: protected function _step($check = null)
      {
          $_steps = (array)$this->request->session()->read('Startup._steps');
          if ($check === null) {
              $_steps[] = $this->request->params['action'];
              $_steps = array_unique($_steps);
              $this->request->session()->write('Startup._steps', $_steps);
          } elseif (is_string($check)) {
              return in_array($check, $_steps);
          }
  
          return false;
      }
code_tokens: protected function _step ( $ check = null ) { $ _steps = ( array ) $ this -> request -> session ( ) -> read ( 'Startup._steps' ) ; if ( $ check === null ) { $ _steps [ ] = $ this -> request -> params [ 'action' ] ; $ _steps = array_unique ( $ _steps ) ; $ this -> request -> session ( ) -> write ( 'Startup._steps' , $ _steps ) ; } elseif ( is_string ( $ check ) ) { return in_array ( $ check , $ _steps ) ; } return false ; }
docstring: Check if the given step name was completed. Or marks current step as
  completed.
  
  If $check is set to NULL, it marks current step (controller's action name)
  as completed. If $check is set to a string, it checks if that step was
  completed before.
  
  This allows steps to control user navigation, so users can not pass to the
  next step without completing all previous steps.
  
  @param null|string $check Name of the step to check, or false to mark as
  completed current step
  @return bool
docstring_tokens: Check if the given step name was completed . Or marks current step as completed .