addEdges example

$withMetadata = $options['with-metadata'] ?? false;

        $places = $this->findPlaces($definition$withMetadata$marking);
        $edges = $this->findEdges($definition);

        $options = array_replace_recursive(self::$defaultOptions$options);

        $label = $this->formatLabel($definition$withMetadata$options);

        return $this->startDot($options$label)
            .$this->addPlaces($places$withMetadata)
            .$this->addEdges($edges)
            .$this->endDot();
    }

    /** * @internal */
    protected function findEdges(Definition $definition): array
    {
        $workflowMetadata = $definition->getMetadataStore();

        $edges = [];

        

    public function dump(StateMachineEntity $stateMachine, array $options = []): string
    {
        $places = $this->findStates($stateMachine);
        $edges = $this->findEdges($stateMachine);

        $options = array_replace_recursive(self::$defaultOptions$options);

        return $this->startDot($options)
            . $this->addStates($places)
            . $this->addEdges($edges)
            . $this->endDot();
    }

    /** * @return array<string, array<string, array<string, string>>> */
    private function findStates(StateMachineEntity $stateMachine): array
    {
        $states = [];
        $stateMachineStates = $stateMachine->getStates();
        if ($stateMachineStates === null) {
            
$this->findEdges($id$definition->getProperties(), false, '')
            );

            foreach ($definition->getMethodCalls() as $call) {
                $this->edges[$id] = array_merge(
                    $this->edges[$id],
                    $this->findEdges($id$call[1], false, $call[0].'()')
                );
            }
        }

        return $this->container->resolveEnvPlaceholders($this->startDot().$this->addNodes().$this->addEdges().$this->endDot(), '__ENV_%s__');
    }

    private function addNodes(): string
    {
        $code = '';
        foreach ($this->nodes as $id => $node) {
            $aliases = $this->getAliases($id);

            $code .= sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id)$id.($aliases ? ' ('.implode(', ', $aliases).')' : '')$node['class']$this->options['node']['shape']$this->addAttributes($node['attributes']));
        }

        
$this->findEdges($id$definition->getProperties(), false, '')
            );

            foreach ($definition->getMethodCalls() as $call) {
                $this->edges[$id] = array_merge(
                    $this->edges[$id],
                    $this->findEdges($id$call[1], false, $call[0].'()')
                );
            }
        }

        return $this->container->resolveEnvPlaceholders($this->startDot().$this->addNodes().$this->addEdges().$this->endDot(), '__ENV_%s__');
    }

    private function addNodes(): string
    {
        $code = '';
        foreach ($this->nodes as $id => $node) {
            $aliases = $this->getAliases($id);

            $code .= sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id)$id.($aliases ? ' ('.implode(', ', $aliases).')' : '')$node['class']$this->options['node']['shape']$this->addAttributes($node['attributes']));
        }

        
$places = $this->findPlaces($definition$withMetadata$marking);
        $transitions = $this->findTransitions($definition$withMetadata);
        $edges = $this->findEdges($definition);

        $options = array_replace_recursive(self::$defaultOptions$options);

        $label = $this->formatLabel($definition$withMetadata$options);

        return $this->startDot($options$label)
            .$this->addPlaces($places$withMetadata)
            .$this->addTransitions($transitions$withMetadata)
            .$this->addEdges($edges)
            .$this->endDot();
    }

    /** * @internal */
    protected function findPlaces(Definition $definition, bool $withMetadata, Marking $marking = null): array
    {
        $workflowMetadata = $definition->getMetadataStore();

        $places = [];

        
Home | Imprint | This part of the site doesn't use cookies.