@param TransitionInterface $transition

@return string
429935
protected function getTransitionLabel(StateInterface $state, TransitionInterface $transition)
    {
        $labelParts = array();
        $eventName = $transition->getEventName();
        if ($eventName) {
            $labelParts[] = 'E: ' . $eventName;
            $event = $state->getEvent($eventName);
            $observerName = $this->convertObserverToString($event);
            if ($observerName) {
                $labelParts[] = 'C: ' . $observerName;
            }
        }
        $conditionName = $transition->getConditionName();
        if ($conditionName) {
            $labelParts[] = 'IF: ' . $conditionName;
        }
        if ($transition instanceof WeightedInterface) {
            $labelParts[] = 'W: ' . $transition->getWeight();
        }

        $label = implode(PHP_EOL, $labelParts);

        return $label;
    }
487953
private function activateTransition(InputInterface $input, OutputInterface $output)
    {
        $next_state = null;
        foreach ($this->state_transitions->get($output->getCurrentState()) as $transition) {
            if ($transition->isActivatedBy($input, $output)) {
                if (is_null($next_state)) {
                    $next_state = $this->states->get($transition->getTo());
                    continue;
                }
                throw new ExecutionError(
                    'Trying to activate more than one transition at a time. Transition: '.
                    $output->getCurrentState().' -> '.$next_state->getName().' was activated first. '.
                    'Now '.$transition->getFrom().' -> '.$transition->getTo().' is being activated too.'
                );
            }
        }
        return $next_state;
    }
211434
protected function getTransitions($class, $prefix = 'TS')
    {
        $cls = new \ReflectionClass($class);

        $transitions = array();
        foreach ($cls->getConstants() as $const => $value) {
            if (preg_match(sprintf('/^%s_.*/', $prefix), $const)) {
                $transitions[$const] = $value;
            }
        }

        return $transitions;
    }
1243534
public static function pushTransitionsOnStack($stack, $transitions)
    {
        $returnValue = array();

        
    	foreach ($transitions as $t){
    		array_push($stack, $t);
    	}
    	
    	$returnValue = $stack;
        

        return (array) $returnValue;
    }
925484
public function modelPlural(RelationInterface $relation)
    {
        if (!isset($this->_modelPlural[$relation->getPropertyName()])) {
            $parts = explode('\\', $relation->getRelatedEntity());
            $name = Text::camelCaseToSeparator(end($parts), '#');
            $name = explode('#', $name);
            $final = ucfirst(Text::plural(strtolower(array_pop($name))));
            $name[] = $final;
            $modelName = '';
            foreach ($name as $part) {
                $modelName .= ucfirst($part);
            }

            $this->_modelPlural[$relation->getPropertyName()] =
                lcfirst($modelName);
        }
        return $this->_modelPlural[$relation->getPropertyName()];
    }
119090
private function getMessage(ErrorInterface $error): string
    {
        $message = $this->formatMessage($error->getMessageTemplate(), $error->getMessageParameters());

        return $message;
    }
342897
public function transform($value)
    {
        $transitions = array();

        foreach ($value as $transition) {
            $transitions[] = $this->generateTransitionName($transition->getStatusFrom(), $transition->getStatusTo());
        }

        return $transitions;
    }
1051609
public function addTransition(TransitionInterface $transition): self
    {
        if (!$this->states->hasKey($transition->getFrom())) {
            throw new UnknownState('Trying to add transition from unknown state: ' . $transition->getFrom());
        }
        if (!$this->states->hasKey($transition->getTo())) {
            throw new UnknownState('Trying to add transition to unknown state: ' . $transition->getTo());
        }
        $transition_key = $transition->getFrom().$transition->getTo();
        if ($this->transitions->hasKey($transition_key)) {
            throw new InvalidStructure(
                sprintf('Trying to add same transition twice: %s -> %s', $transition->getFrom(), $transition->getTo())
            );
        }
        $builder = clone $this;
        $builder->transitions[$transition_key] = $transition;
        return $builder;
    }
1048567
public function getTransitions()
    {
        if (count($this->transitions) == 0 && !$this->isInitialType() && !$this->isExceptionType()) {
            foreach ($this->properties['transitions_from'] as $transition) {
                array_push($this->transitions, new Transition($this, $transition));
            }

            if (count($this->transitions) == 0) {
                throw new StatusException('No transitions available', 100, null);
            }
        } elseif ($this->isInitialType() || $this->isExceptionType()) {
            $this->transitions = [];
        }

        return $this->transitions;
    }
145856
public function canTransition($subject, $transitionName, $name = null)
    {
        return $this->workflowRegistry->get($subject, $name)->can($subject, $transitionName);
    }
609168
public function logTransition(Transition $transition)
    {
        $this
            ->logger
            ->info(
                'Transition {transition_name} in machine "{machine_id}" from "{state_from}" to "{state_to}"',
                [
                    'transition_name' => $transition->getName(),
                    'machine_id' => $this->machine->getId(),
                    'state_from' => $transition->getStart()->getName(),
                    'state_to' => $transition->getFinal()->getName(),
                ]
            );
    }
1125393
public function getInstallPath(PackageInterface $package): string
    {
        $this->vendorPath = parent::getInstallPath($package);
        return $this->vendorPath;
    }
336523
public function apply($transitionName, array $parameters = array())
    {
        $transition = $this->getTransition($transitionName);
        $event = new TransitionEvent($this->getCurrentState(), $transition, $this, $parameters);
        if (!$this->can($transition, $parameters)) {
            throw new Exception\StateException(sprintf(
                'The "%s" transition can not be applied to the "%s" state of object "%s" with graph "%s".',
                $transition->getName(),
                $this->currentState->getName(),
                get_class($this->getObject()),
                $this->getGraph()
            ));
        }

        $this->dispatchTransitionEvent($transition, $event, FiniteEvents::PRE_TRANSITION);

        $returnValue = $transition->process($this);
        $this->stateAccessor->setState($this->object, $transition->getState());
        $this->currentState = $this->getState($transition->getState());

        $this->dispatchTransitionEvent($transition, $event, FiniteEvents::POST_TRANSITION);

        return $returnValue;
    }
305718
private function getHtmlTagForMark(MarkInterface $mark): string
    {
        $type = $mark->getType();
        $tags = [
            'bold' => 'strong',
            'code' => 'code',
            'italic' => 'em',
            'underline' => 'u',
        ];

        return $tags[$type] ?? 'span';
    }
100341
public function getTransitionsByFinalState($stateName)
    {
        return array_filter(
            $this->transitions,
            function (Transition $transition) use ($stateName) {
                return $transition
                    ->getFinal()
                    ->getName() === $stateName;
            }
        );
    }
998886
protected function _setTransition($transition)
    {
        $this->transition = ($transition === null)
            ? null
            : $this->_normalizeStringable($transition);
    }
182077
public function convert(ElementInterface $element)
    {
        // Contents should have already been converted to Markdown by this point,
        // so we just need to add '>' symbols to each line.

        $markdown = '';

        $quote = trim($element->getValue());

        $lines = preg_split('/\r\n|\r|\n/', $quote);

        $total = count((array) $lines);

        foreach ($lines as $i => $line)
        {
            $markdown .= '> ' . $line . "\n";

            $newline = $i + 1 === $total;

            $newline && $markdown .= "\n";
        }

        return "\n\n" . $markdown;
    }