Skip to content

Commit f01c36a

Browse files
committed
Update the GraphViz exporter so it's easy to override Gv::getNodeAttributes().
1 parent f5790eb commit f01c36a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Exporter/Gv.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function ($key, $data) {
5757
$nodes[] = \sprintf(
5858
' "%s" %s',
5959
$this->getHash($child),
60-
$this->getNodeAttributes($child)
60+
$this->attributesArrayToText($this->getNodeAttributes($child))
6161
);
6262
}
6363

@@ -212,10 +212,10 @@ protected function getHash(NodeInterface $node): string
212212
* @param \drupol\phptree\Node\NodeInterface $node
213213
* The node interface.
214214
*
215-
* @return string
216-
* The attributes as a string.
215+
* @return array
216+
* The attributes as an array.
217217
*/
218-
protected function getNodeAttributes(NodeInterface $node): string
218+
protected function getNodeAttributes(NodeInterface $node): array
219219
{
220220
$attributes = [];
221221

@@ -229,6 +229,6 @@ protected function getNodeAttributes(NodeInterface $node): string
229229
}
230230
}
231231

232-
return $this->attributesArrayToText($attributes);
232+
return $attributes;
233233
}
234234
}

0 commit comments

Comments
 (0)