Skip to content

Commit d9ba43e

Browse files
committed
Fix code-style and tests.
1 parent 9940b9a commit d9ba43e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

spec/drupol/phptree/Exporter/GvSpec.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,22 @@ public function it_can_export_to_dot_gv()
5656

5757
$result = <<<EOF
5858
digraph PHPTreeGraph {
59-
59+
// The graph attributes.
6060
ratio = fill
6161
node [style="filled"]
6262
63+
// The graph nodes.
6364
"{$nodes['root']['hash']}" [label="{$nodes['root']['value']}"]
6465
"{$nodes['child1']['hash']}" [label="{$nodes['child1']['value']}"]
6566
"{$nodes['child4']['hash']}" [label="{$nodes['child4']['value']}"]
6667
"{$nodes['child2']['hash']}" [label="{$nodes['child2']['value']}"]
6768
"{$nodes['child3']['hash']}" [label="{$nodes['child3']['value']}"]
6869
70+
// The graph edges.
6971
"{$nodes['root']['hash']}" -> "{$nodes['child1']['hash']}";
7072
"{$nodes['child1']['hash']}" -> "{$nodes['child4']['hash']}";
7173
"{$nodes['root']['hash']}" -> "{$nodes['child2']['hash']}";
7274
"{$nodes['root']['hash']}" -> "{$nodes['child3']['hash']}";
73-
7475
}
7576
EOF;
7677
$this
@@ -81,21 +82,22 @@ public function it_can_export_to_dot_gv()
8182

8283
$result = <<<EOF
8384
graph PHPTreeGraph {
84-
85+
// The graph attributes.
8586
ratio = fill
8687
node [style="filled"]
8788
89+
// The graph nodes.
8890
"{$nodes['root']['hash']}" [label="{$nodes['root']['value']}"]
8991
"{$nodes['child1']['hash']}" [label="{$nodes['child1']['value']}"]
9092
"{$nodes['child4']['hash']}" [label="{$nodes['child4']['value']}"]
9193
"{$nodes['child2']['hash']}" [label="{$nodes['child2']['value']}"]
9294
"{$nodes['child3']['hash']}" [label="{$nodes['child3']['value']}"]
9395
96+
// The graph edges.
9497
"{$nodes['root']['hash']}" -- "{$nodes['child1']['hash']}";
9598
"{$nodes['child1']['hash']}" -- "{$nodes['child4']['hash']}";
9699
"{$nodes['root']['hash']}" -- "{$nodes['child2']['hash']}";
97100
"{$nodes['root']['hash']}" -- "{$nodes['child3']['hash']}";
98-
99101
}
100102
EOF;
101103
$this

src/Exporter/Gv.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ public function export(NodeInterface $node): string
7575
}
7676

7777
return $this->getGv(
78-
implode(PHP_EOL, $attributes),
79-
implode(PHP_EOL, $nodes),
80-
implode(PHP_EOL, $edges)
78+
\implode(PHP_EOL, $attributes),
79+
\implode(PHP_EOL, $nodes),
80+
\implode(PHP_EOL, $edges)
8181
);
8282
}
8383

src/Node/TrieNode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TrieNode extends KeyValueNode
1414
*/
1515
public function add(NodeInterface ...$nodes): NodeInterface
1616
{
17-
/** @var \drupol\phptree\Node\ValueNodeInterface $node */
17+
/** @var \drupol\phptree\Node\KeyValueNodeInterface $node */
1818
foreach ($nodes as $node) {
1919
$data = $node->getValue();
2020

0 commit comments

Comments
 (0)