Skip to content

Commit

Permalink
Update KeyValueGraph exporter.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 13, 2019
1 parent eb4efa8 commit 0b1717d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/src/Exporter/KeyValueGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

namespace drupol\phptree\tests\Exporter;

use drupol\phptree\Exporter\Graph;
use drupol\phptree\Node\KeyValueNodeInterface;
use drupol\phptree\Node\NodeInterface;
use Fhaculty\Graph\Vertex;

/**
* Class KeyValueGraph.
*/
class KeyValueGraph extends ValueGraph
class KeyValueGraph extends Graph
{
/**
* {@inheritdoc}
Expand All @@ -21,7 +22,7 @@ protected function createVertex(NodeInterface $node): Vertex
$vertex = parent::createVertex($node);

if ($node instanceof KeyValueNodeInterface) {
$vertex->setAttribute('graphviz.label', $node->getValue());
$vertex->setAttribute('graphviz.label', $node->getKey() . $vertex->getAttribute('graphviz.label'));
}

return $vertex;
Expand Down

0 comments on commit 0b1717d

Please sign in to comment.