Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function build(array $table) |
||
11 | { |
||
12 | $collection = new NodeCollection; |
||
13 | foreach ($table as $line => $columns) { |
||
14 | foreach ($columns as $column => $content) { |
||
15 | $collection->addNode($node = new Node, $line, $column); |
||
16 | $node->setContent($content); |
||
17 | $node->setTop($collection->atPosition($line - 1, $column)); |
||
18 | $node->setBottom($collection->atPosition($line + 1, $column)); |
||
19 | $node->setLeft($collection->atPosition($line, $column - 1)); |
||
20 | $node->setLeft($collection->atPosition($line, $column + 1)); |
||
21 | } |
||
22 | } |
||
23 | |||
24 | return $collection; |
||
25 | } |
||
26 | } |
||
27 |