Machine step

@return void
170064
protected function step()
    {
        switch ($this->state) {
            case self::STATE_ZERO_POINT:
                $this->zeroPoint();
                break;

            case self::STATE_READ_DIRECTIVE:
                $this->readDirective();
                break;

            case self::STATE_SKIP_SPACE:
                $this->skipSpace();
                break;

            case self::STATE_SKIP_LINE:
                $this->skipLine();
                break;

            case self::STATE_READ_VALUE:
                $this->readValue();
                break;
        }
    }
1005736
private function performStep($sessionId, Step $step, Context $context, $currentIteration)
    {
        switch (true) {
            case $step instanceof Merge:
                $newContext = $this->actionMapping->merge($sessionId, $context, $step);
                $context = $this->converse($sessionId, null, $newContext, --$currentIteration);
                break;
            case $step instanceof Message:
                $this->actionMapping->say($sessionId, $context, $step);
                $context = $this->converse($sessionId, null, $context, --$currentIteration);
                break;
            case $step instanceof Action:
                $newContext = $this->actionMapping->action($sessionId, $context, $step);
                $context = $this->converse($sessionId, null, $newContext, --$currentIteration);
                break;
            case $step instanceof Stop:
                $this->actionMapping->stop($sessionId, $context, $step);
                break;
        }

        return $context;
    }
310133
public function process() {
        /* @var $currentStep StepController */
        /* @var $ancestorStep StepController */
        /* @var $descendantStep StepController */
        $currentStep = $this->stepCollectionIterator->current();
        if ($this->stepAction == self::WIZARD_STEP_ACTION_PREV && !$this->stepCollection->isFirst($this->stepCollectionIterator->current())) {
            $currentStep->leaveToAncestorStep();
            $this->stepCollectionIterator->previous();
            $ancestorStep = $this->stepCollectionIterator->current();
            $ancestorStep->enterFromDescendant();
            $this->resultContent = $this->prepareNextStepView($ancestorStep);
        } elseif ($this->stepAction == self::WIZARD_STEP_ACTION_PREV && $this->stepCollection->isFirst($this->stepCollectionIterator->current())) {
            $this->resultContent = new ResponseConfigurator();
        }
        if ($this->stepAction == self::WIZARD_STEP_ACTION_NEXT) {
            $currentStep->preProcess();
            if ($currentStep->process($currentStep->standardClosureArguments())) {
                $currentStep->postProcess();
                $currentStep->leaveStep();
                $this->stepCollectionIterator->next();

                $descendantStep = $this->stepCollectionIterator->current();
                $descendantStep->enterStep();
                $this->resultContent = $this->prepareNextStepView($descendantStep);
            } else {
                $this->resultContent = $this->prepareNextStepView($currentStep);
                $this->resultContent->setVariable("errorMessage", $currentStep->getProcessErrorMessage());
            }

        }
    }
1243290
public function run()
	{
		Eloquent::unguard();

		$this->call('DomAndTom\LaravelSwagger\CategoryTableSeeder');
		$this->command->info('Laravel Swagger Demo Categories seeded!');

		$this->call('DomAndTom\LaravelSwagger\TagTableSeeder');
		$this->command->info('Laravel Swagger Demo Tags seeded!');

		$this->call('DomAndTom\LaravelSwagger\PetTableSeeder');
		$this->command->info('Laravel Swagger Demo Pets seeded!');
	}
502164
public function ExecuteStep()
    {
        if ($this->ProcessStep()) {
            $this->ProcessStepSuccessHook();
            $oBasket = TShopBasket::GetInstance();
            $oBasket->aCompletedOrderStepList[$this->fieldSystemname] = true;
            $oNextStep = $this->GetNextStep();
            $this->JumpToStep($oNextStep);
        }
    }
1186871
public function boot()
    {
        collect(glob(__DIR__ . '/Database/Schema/macros/*.php'))
            ->each(function($path) {
                require $path;
            });

        /* A little hack to have Builder::hasMacro */
        \Illuminate\Database\Eloquent\Builder::macro('hasMacro', function($name) {
            return isset(static::$macros[$name]);
        });

        collect(glob(__DIR__ . '/Models/macros/*.php'))
            ->each(function($path) {
                require $path;
            });
    }
700309
protected function firstStep()
    {
        $this->logger->info('Beginning the first step');

        // Allocate all the ballots
        foreach ($this->ballots as $i => $ballot) {
            $this->allocateVotes($ballot);
        }

        $this->logger->notice('Step 1 complete',
            ['candidatesStatus' => $this->election->getCandidatesStatus()]
        );

        $this->steps[1] = $this->election->getCandidatesStatus();

        return;
    }
347273
public function walk() {
        $this->_beforeWalk();
        foreach ($this->_result as $result) {
            call_user_func($this->_function, $result);
        }
        $this->_afterWalk();
    }
124091
protected function doStep()
    {
        // Wait for the next read request
        /** @var ReadRequest $req */
        $req = $this->decoder->decode(ReadRequest::class);
        try {
            $this->checkUnsupportedTypes($req->getIds());
            $entities = $this->read($req->getIds());
            $res = ReadResponse::success($entities);
        } catch (Exception $ex) {
            $res = ReadResponse::error($ex);
        }
        // Send the result back to the host
        $this->encoder->encode($res);
    }
112317
public function render()
	{
		$this->template->steps = $this->getSteps();
		$this->template->paginator = $this->getPaginator();
		$this->template->setFile($this->templateFile)->render();
	}
1037430
public function execute(){
    
        if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime())
            $this->is_running = false;
    
        if(!$this->is_running){
            $this->last_result = false;
            $this->is_running = true;
            $this->save();
    
            Log::addDebugLog('Start execution of Admin task: '.$this->getTitle());
            $this->last_result = $this->executeSteps();
            if($this->last_result){
                $this->last_updated = new \DateTime();
                if($this->nb_occurrences > 0){
                    $this->nb_occurrences--;
                    if($this->nb_occurrences == 0) $this->is_enabled = false;
                }
            }
            $this->is_running = false;
            $this->save();
            Log::addDebugLog('Execution completed for Admin task: '.$this->getTitle().' - '.($this->last_result ? 'Success' : 'Failure'));
        }
    }
980818
protected function ProcessStep()
    {
        if ($this->IsChangeShipToBillingStateRequest() || $this->PreventProcessStepMethodFromExecuting()) {
            $bContinue = false;
        } else {
            $bContinue = parent::ProcessStep();

            $bContinue = $this->ValidateStepData() && $bContinue;

            if ($bContinue) {
                $this->UpdateUser($this->GetUserData());
                // if we ship to billing address, we update only the primary address and change the secondary address to match this
                if ('1' == $this->GetShipToBillingAddress()) {
                    $oUser = self::getExtranetUserProvider()->getActiveUser();
                    switch ($this->AddressUsedAsPrimaryAddress()) {
                        case TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING:
                            $this->UpdateShippingAddress($this->GetShippingAddressData());
                            if (false == $oUser->ShipToBillingAddress()) {
                                // we need to set the billing address based on the shipping address
                                if (!empty($oUser->id)) {
                                    $oUser->SetAddressAsBillingAddress($oUser->fieldDefaultShippingAddressId);
                                } else {
                                    $oShippingAddress = $oUser->GetShippingAddress(true);
                                    if (null !== $oShippingAddress) {
                                        $oUser->UpdateBillingAddress($oShippingAddress->sqlData);
                                    }
                                }
                                $oUser->GetBillingAddress(true);
                            }
                            break;
                        default:
                        case TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING:
                            $this->UpdateBillingAddress($this->GetBillingAddressData());
                            // we need to set the billing address based on the shipping address
                            if (!empty($oUser->id)) {
                                $oUser->SetAddressAsShippingAddress($oUser->fieldDefaultBillingAddressId);
                            } else {
                                $oBillingAddress = $oUser->GetBillingAddress(true);
                                if (null !== $oBillingAddress) {
                                    $oUser->UpdateShippingAddress($oBillingAddress->sqlData);
                                }
                            }
                            $oUser->GetShippingAddress(true);
                            break;
                    }
                } else {
                    $this->UpdateBillingAddress($this->GetBillingAddressData());
                    $this->UpdateShippingAddress($this->GetShippingAddressData());
                }
            }
        }

        return $bContinue;
    }
1116055
protected function doStep()
    {
        // Wait for the next write request
        /** @var WriteRequest $req */
        $req = $this->decoder->decode(WriteRequest::class);
        try {
            $this->checkUnsupportedTypes($req->getEntities());
            $this->write($req->getEntities());
            $res = WriteResponse::success();
        } catch (Exception $ex) {
            $res = WriteResponse::error($ex);
        }
        // Send the result back to the host
        $this->encoder->encode($res);
    }
1010265
public function gotoStep()
    {
        $step = $this->Controller()->getRequest()->getVar('step');
        if ($step > 0 && $step <= self::getMaxStep()) {
            self::setCurrentStep($step);
        }
        return $this->Controller()->redirectBack();
    }
1075060
def step(self):
        """"""
        op = self.code[self.instruction_pointer]
        self.instruction_pointer += 1
        op(self)
782510
public function init()
    {
        // If the step is not a registered step exit
        if (!in_array($this->step, CheckoutSteps::getSteps())) {
            $this->redirect($this->Link('/'));
        }

        // If no ReservationSession exists redirect back to the base event controller
        elseif (empty(ReservationSession::get())) {
            $this->redirect($this->Link('/'));
        }

        // If the reservation has been processed end the session and redirect
        elseif (ReservationSession::get()->Status === 'PAID' && $this->step != 'success') {
            ReservationSession::end();
            $this->redirect($this->Link('/'));
        } else {
            $this->reservation = ReservationSession::get();
            parent::init();
        }
    }
990555
public function step() {
		$action = $this->request->param('ID');
		$step = $this->pipeline->CurrentStep();

		// Check if the action is available on this step
		if($step && ($actions = $step->allowedActions()) && isset($actions[$action])) {
			// Execute this action, allowing it to override the httpresponse given
			$step->$action();
		}
		return $this->redirect($this->pipeline->Environment()->Link());
	}