Conditions | 5 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function render() : string |
||
31 | { |
||
32 | $string = ''; |
||
33 | $diff = $this->diff->toArray(); |
||
34 | |||
35 | // loop over the lines in the diff |
||
36 | foreach ($diff as $line) |
||
37 | { |
||
38 | // extend the string with the line |
||
39 | switch ($line[1]) |
||
40 | { |
||
41 | case Diff::UNMODIFIED : $string .= ' ' . $line[0];break; |
||
42 | case Diff::DELETED : $string .= '- ' . $line[0];break; |
||
43 | case Diff::INSERTED : $string .= '+ ' . $line[0];break; |
||
44 | } |
||
45 | |||
46 | // extend the string with the separator |
||
47 | $string .= $this->separator; |
||
48 | } |
||
49 | |||
50 | return $string; |
||
51 | } |
||
53 |