/** * Creates an array of dot-graph node from the given state machine. * One node is created for each state within the state machine. * Also the 'uml start node' is added in addition to the state nodes. * * @param StateMachineInterface $state_machine * * @return array An array of strings, that represent the particular dot-graph nodes. */ protected function getNodes(StateMachineInterface $state_machine) { $state_nodes = []; foreach ($state_machine->getStates() as $state) { $state_nodes[] = $this->createStateNode($state_machine, $state); } $state_nodes[] = sprintf('0 [label="X" fontsize="%s" margin="0" fontname="%s" width="0.15" color="%s" shape="circle"]', self::STATE_NODE_FONTSIZE, self::STATE_NODE_FONTNAME, self::STATE_NODE_COLOR); return $state_nodes; }