Metabor\Statemachine\Graph\GraphBuilder::createStatusVertex PHP Method

createStatusVertex() public method

public createStatusVertex ( MetaborStd\Statemachine\StateInterface $state ) : Fhaculty\Graph\Vertex
$state MetaborStd\Statemachine\StateInterface
return Fhaculty\Graph\Vertex
    public function createStatusVertex(StateInterface $state)
    {
        $stateName = $state->getName();
        $vertex = $this->graph->createVertex($stateName, true);
        if ($state instanceof \ArrayAccess) {
            $layout = $this->getLayoutOptions($state, $this->stateLayout);
            if (method_exists($vertex, 'setLayout')) {
                $vertex->setLayout($layout);
            } else {
                foreach ($layout as $name => $value) {
                    $vertex->setAttribute('graphviz.' . $name, $value);
                }
            }
        }
        return $vertex;
    }