public function getTransitionByStartingStateAndFinalState(
        $startStateName,
        $finalStateName
    ) {
        $transition = array_filter(
            $this->transitions,
            function (Transition $transition) use ($startStateName, $finalStateName) {
                return
                    $transition->getStart()->getName() === $startStateName &&
                    $transition->getFinal()->getName() === $finalStateName;
            }
        );

        return !empty($transition)
            ? reset($transition)
            : null;
    }
public function getTransitionByStartingStateAndFinalState(
        $startStateName,
        $finalStateName
    ) {
        $transition = array_filter(
            $this->transitions,
            function (Transition $transition) use ($startStateName, $finalStateName) {
                return
                    $transition->getStart()->getName() === $startStateName &&
                    $transition->getFinal()->getName() === $finalStateName;
            }
        );

        return !empty($transition)
            ? reset($transition)
            : null;
    }
public function getTransitionByStartingStateAndFinalState ( $ startStateName , $ finalStateName ) { $ transition = array_filter ( $ this -> transitions , function ( Transition $ transition ) use ( $ startStateName , $ finalStateName ) { return $ transition -> getStart ( ) -> getName ( ) === $ startStateName && $ transition -> getFinal ( ) -> getName ( ) === $ finalStateName ; } ) ; return ! empty ( $ transition ) ? reset ( $ transition ) : null ; }
Get transition starting state name and final state name.

@param string $startStateName Start state name
@param string $finalStateName Final state name

@return Transition|null Transition if exists
Get transition starting state name and final state name .