src/Infrastructure/Workflow/WorkflowService.php
public function resolveStateMachineName($arg)
    {
        if (is_string($arg) && empty(trim($arg))) {
            throw new RuntimeError('State machine name must be a non-empty string.');
        }

        if (is_string($arg)) {
            return $arg;
        }

        $default_suffix = $this->config->get('state_machine_name_suffix', 'default_workflow');

        if ($arg instanceof AggregateRootTypeInterface || $arg instanceof ProjectionTypeInterface) {
            return $arg->getPrefix() . '.' . $default_suffix;
        } elseif ($arg instanceof AggregateRootInterface || $arg instanceof ProjectionInterface) {
            return $arg->getType()->getPrefix() . '.' . $default_suffix;
        } elseif (is_object($arg) && is_callable($arg, 'getStateMachineName')) {
            return $arg->getStateMachineName();
        } elseif (is_object($arg) && is_callable($arg, '__toString')) {
            return (string)$arg;
        }

        throw new RuntimeError('Could not resolve a state machine name for given argument.');
    }
public function resolveStateMachineName($arg)
    {
        if (is_string($arg) && empty(trim($arg))) {
            throw new RuntimeError('State machine name must be a non-empty string.');
        }

        if (is_string($arg)) {
            return $arg;
        }

        $default_suffix = $this->config->get('state_machine_name_suffix', 'default_workflow');

        if ($arg instanceof AggregateRootTypeInterface || $arg instanceof ProjectionTypeInterface) {
            return $arg->getPrefix() . '.' . $default_suffix;
        } elseif ($arg instanceof AggregateRootInterface || $arg instanceof ProjectionInterface) {
            return $arg->getType()->getPrefix() . '.' . $default_suffix;
        } elseif (is_object($arg) && is_callable($arg, 'getStateMachineName')) {
            return $arg->getStateMachineName();
        } elseif (is_object($arg) && is_callable($arg, '__toString')) {
            return (string)$arg;
        }

        throw new RuntimeError('Could not resolve a state machine name for given argument.');
    }
public function resolveStateMachineName ( $ arg ) { if ( is_string ( $ arg ) && empty ( trim ( $ arg ) ) ) { throw new RuntimeError ( 'State machine name must be a non-empty string.' ) ; } if ( is_string ( $ arg ) ) { return $ arg ; } $ default_suffix = $ this -> config -> get ( 'state_machine_name_suffix' , 'default_workflow' ) ; if ( $ arg instanceof AggregateRootTypeInterface || $ arg instanceof ProjectionTypeInterface ) { return $ arg -> getPrefix ( ) . '.' . $ default_suffix ; } elseif ( $ arg instanceof AggregateRootInterface || $ arg instanceof ProjectionInterface ) { return $ arg -> getType ( ) -> getPrefix ( ) . '.' . $ default_suffix ; } elseif ( is_object ( $ arg ) && is_callable ( $ arg , 'getStateMachineName' ) ) { return $ arg -> getStateMachineName ( ) ; } elseif ( is_object ( $ arg ) && is_callable ( $ arg , '__toString' ) ) { return ( string ) $ arg ; } throw new RuntimeError ( 'Could not resolve a state machine name for given argument.' ) ; }
Resolves a name for the given item that can be used to build or lookup an already built state machine.

@param mixed $arg object to resolve a name for

@return string name to use for state machine lookups/building

@throws RuntimeError when no name can be resolved
Resolves a name for the given item that can be used to build or lookup an already built state machine .