private function checkTransitionDuplicates(TransitionChain $transitionChain)
    {
        $states = [];

        /**
         * @var Transition $transition
         */
        foreach ($transitionChain->getTransitions() as $transition) {
            $startingStateName = $transition->getStart()->getName();
            $transitionName = $transition->getName();

            if (isset($states[$startingStateName])) {
                if (isset($states[$startingStateName][$transitionName])) {
                    throw new InconsistentTransitionConfigurationException(
                        $startingStateName,
                        $transitionName
                    );
                }
            } else {
                $states[$startingStateName] = [];
            }

            $states[$startingStateName][$transitionName] = true;
        }

        return $this;
    }
private function checkTransitionDuplicates(TransitionChain $transitionChain)
    {
        $states = [];

        /**
         * @var Transition $transition
         */
        foreach ($transitionChain->getTransitions() as $transition) {
            $startingStateName = $transition->getStart()->getName();
            $transitionName = $transition->getName();

            if (isset($states[$startingStateName])) {
                if (isset($states[$startingStateName][$transitionName])) {
                    throw new InconsistentTransitionConfigurationException(
                        $startingStateName,
                        $transitionName
                    );
                }
            } else {
                $states[$startingStateName] = [];
            }

            $states[$startingStateName][$transitionName] = true;
        }

        return $this;
    }
private function checkTransitionDuplicates ( TransitionChain $ transitionChain ) { $ states = [ ] ; /**
         * @var Transition $transition
         */ foreach ( $ transitionChain -> getTransitions ( ) as $ transition ) { $ startingStateName = $ transition -> getStart ( ) -> getName ( ) ; $ transitionName = $ transition -> getName ( ) ; if ( isset ( $ states [ $ startingStateName ] ) ) { if ( isset ( $ states [ $ startingStateName ] [ $ transitionName ] ) ) { throw new InconsistentTransitionConfigurationException ( $ startingStateName , $ transitionName ) ; } } else { $ states [ $ startingStateName ] = [ ] ; } $ states [ $ startingStateName ] [ $ transitionName ] = true ; } return $ this ; }
Check transitions duplicates.

An transition from a state should exist once

@param TransitionChain $transitionChain Transition chain

@return $this Self object

@throws InconsistentTransitionConfigurationException Duplicated pair of
state-transition
Check transitions duplicates .