SM\Factory\Factory::createStateMachine PHP Method

createStateMachine() protected method

{@inheritDoc}
protected createStateMachine ( $object, array $config )
$config array
    protected function createStateMachine($object, array $config)
    {
        if (!isset($config['state_machine_class'])) {
            $class = 'SM\\StateMachine\\StateMachine';
        } elseif (class_exists($config['state_machine_class'])) {
            $class = $config['state_machine_class'];
        } else {
            throw new SMException(sprintf('Class "%s" for creating a new state machine does not exist.', $config['state_machine_class']));
        }
        return new $class($object, $config, $this->dispatcher, $this->callbackFactory);
    }