Conditions | 6 |
Paths | 5 |
Total Lines | 28 |
Code Lines | 19 |
Lines | 7 |
Ratio | 25 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public function getLines() |
||
35 | { |
||
36 | $this->coveredLines = []; |
||
37 | $reader = new XMLReader; |
||
38 | $reader->open($this->file); |
||
39 | $currentFile = ''; |
||
40 | while ($reader->read()) { |
||
41 | View Code Duplication | if (( |
|
42 | $reader->name === "file" && |
||
43 | $reader->nodeType == XMLReader::ELEMENT |
||
44 | )) { |
||
45 | $currentFile = $reader->getAttribute('name'); |
||
46 | $this->coveredLines[$currentFile] = []; |
||
47 | } |
||
48 | |||
49 | if (( |
||
50 | $reader->name === "line" && |
||
51 | $reader->getAttribute("type") == "stmt" |
||
52 | )) { |
||
53 | $this->coveredLines |
||
54 | [$currentFile] |
||
55 | [$reader->getAttribute('num')] |
||
56 | = (int) $reader->getAttribute("count"); |
||
57 | } |
||
58 | } |
||
59 | |||
60 | return $this->coveredLines; |
||
61 | } |
||
62 | |||
92 |