src/Infrastructure/Workflow/XmlStateMachineBuilder.php
protected function createTransition($state_name, array $transition_definition)
    {
        $target = $transition_definition['outgoing_state_name'];
        $guard_definition = $transition_definition['guard'];

        $guard = null;
        if ($guard_definition) {
            $guard = $this->service_locator->make(
                $guard_definition['class'],
                [
                    ':options' => $guard_definition['options'],
                ]
            );

            if (!$guard instanceof GuardInterface) {
                throw new RuntimeError(
                    sprintf(
                        "Given transition guard '%s' must implement: %s",
                        $guard_definition['class'],
                        GuardInterface::CLASS
                    )
                );
            }
        }

        return new Transition($state_name, $target, $guard);
    }
protected function createTransition($state_name, array $transition_definition)
    {
        $target = $transition_definition['outgoing_state_name'];
        $guard_definition = $transition_definition['guard'];

        $guard = null;
        if ($guard_definition) {
            $guard = $this->service_locator->make(
                $guard_definition['class'],
                [
                    ':options' => $guard_definition['options'],
                ]
            );

            if (!$guard instanceof GuardInterface) {
                throw new RuntimeError(
                    sprintf(
                        "Given transition guard '%s' must implement: %s",
                        $guard_definition['class'],
                        GuardInterface::CLASS
                    )
                );
            }
        }

        return new Transition($state_name, $target, $guard);
    }
protected function createTransition ( $ state_name , array $ transition_definition ) { $ target = $ transition_definition [ 'outgoing_state_name' ] ; $ guard_definition = $ transition_definition [ 'guard' ] ; $ guard = null ; if ( $ guard_definition ) { $ guard = $ this -> service_locator -> make ( $ guard_definition [ 'class' ] , [ ':options' => $ guard_definition [ 'options' ] , ] ) ; if ( ! $ guard instanceof GuardInterface ) { throw new RuntimeError ( sprintf ( "Given transition guard '%s' must implement: %s" , $ guard_definition [ 'class' ] , GuardInterface :: CLASS ) ) ; } } return new Transition ( $ state_name , $ target , $ guard ) ; }
Creates a state transition from the given transition definition.

@param string $state_name
@param array $transition_definition

@return Workflux\Transition\TransitionInterface
Creates a state transition from the given transition definition .