private function applyTransitionAction(
        $object,
        StateLineStack $stateLineStack,
        $transitionName,
        $description,
        $transitionAction
    ) {
        $startState = $stateLineStack->getLastStateLine();

        if (!($startState instanceof StateLineInterface)) {
            throw new ObjectNotInitializedException();
        }

        /**
         * @var Transition $transition
         */
        $transition = $this
            ->machine
            ->$transitionAction(
                $startState->getName(),
                $transitionName
            );

        $stateLine = $this->createStateLine(
            $transition->getFinal()->getName(),
            $description
        );

        $stateLineStack->addStateLine($stateLine);

        $this
            ->machineEventDispatcher
            ->dispatchTransitionEvents(
                $this->machine,
                $object,
                $stateLineStack,
                $transition
            );

        return $stateLineStack;
    }