Skip to content

Commit

Permalink
Fix code-style and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 26, 2019
1 parent 9940b9a commit d9ba43e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions spec/drupol/phptree/Exporter/GvSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,22 @@ public function it_can_export_to_dot_gv()

$result = <<<EOF
digraph PHPTreeGraph {
// The graph attributes.
ratio = fill
node [style="filled"]
// The graph nodes.
"{$nodes['root']['hash']}" [label="{$nodes['root']['value']}"]
"{$nodes['child1']['hash']}" [label="{$nodes['child1']['value']}"]
"{$nodes['child4']['hash']}" [label="{$nodes['child4']['value']}"]
"{$nodes['child2']['hash']}" [label="{$nodes['child2']['value']}"]
"{$nodes['child3']['hash']}" [label="{$nodes['child3']['value']}"]
// The graph edges.
"{$nodes['root']['hash']}" -> "{$nodes['child1']['hash']}";
"{$nodes['child1']['hash']}" -> "{$nodes['child4']['hash']}";
"{$nodes['root']['hash']}" -> "{$nodes['child2']['hash']}";
"{$nodes['root']['hash']}" -> "{$nodes['child3']['hash']}";
}
EOF;
$this
Expand All @@ -81,21 +82,22 @@ public function it_can_export_to_dot_gv()

$result = <<<EOF
graph PHPTreeGraph {
// The graph attributes.
ratio = fill
node [style="filled"]
// The graph nodes.
"{$nodes['root']['hash']}" [label="{$nodes['root']['value']}"]
"{$nodes['child1']['hash']}" [label="{$nodes['child1']['value']}"]
"{$nodes['child4']['hash']}" [label="{$nodes['child4']['value']}"]
"{$nodes['child2']['hash']}" [label="{$nodes['child2']['value']}"]
"{$nodes['child3']['hash']}" [label="{$nodes['child3']['value']}"]
// The graph edges.
"{$nodes['root']['hash']}" -- "{$nodes['child1']['hash']}";
"{$nodes['child1']['hash']}" -- "{$nodes['child4']['hash']}";
"{$nodes['root']['hash']}" -- "{$nodes['child2']['hash']}";
"{$nodes['root']['hash']}" -- "{$nodes['child3']['hash']}";
}
EOF;
$this
Expand Down
6 changes: 3 additions & 3 deletions src/Exporter/Gv.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public function export(NodeInterface $node): string
}

return $this->getGv(
implode(PHP_EOL, $attributes),
implode(PHP_EOL, $nodes),
implode(PHP_EOL, $edges)
\implode(PHP_EOL, $attributes),
\implode(PHP_EOL, $nodes),
\implode(PHP_EOL, $edges)
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Node/TrieNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TrieNode extends KeyValueNode
*/
public function add(NodeInterface ...$nodes): NodeInterface
{
/** @var \drupol\phptree\Node\ValueNodeInterface $node */
/** @var \drupol\phptree\Node\KeyValueNodeInterface $node */
foreach ($nodes as $node) {
$data = $node->getValue();

Expand Down

0 comments on commit d9ba43e

Please sign in to comment.