@@ -45,7 +45,6 @@ public function process(CodeCoverage $coverage, $target = null, $name = null)
45
45
46
46
$ packages = [];
47
47
$ report = $ coverage ->getReport ();
48
- unset($ coverage );
49
48
50
49
foreach ($ report as $ item ) {
51
50
if (!$ item instanceof File) {
@@ -57,10 +56,10 @@ public function process(CodeCoverage $coverage, $target = null, $name = null)
57
56
$ xmlFile = $ xmlDocument ->createElement ('file ' );
58
57
$ xmlFile ->setAttribute ('name ' , $ item ->getPath ());
59
58
60
- $ classes = $ item ->getClassesAndTraits ();
61
- $ coverage = $ item ->getCoverageData ();
62
- $ lines = [];
63
- $ namespace = 'global ' ;
59
+ $ classes = $ item ->getClassesAndTraits ();
60
+ $ coverageData = $ item ->getCoverageData ();
61
+ $ lines = [];
62
+ $ namespace = 'global ' ;
64
63
65
64
foreach ($ classes as $ className => $ class ) {
66
65
$ classStatements = 0 ;
@@ -84,8 +83,8 @@ public function process(CodeCoverage $coverage, $target = null, $name = null)
84
83
$ methodCount = 0 ;
85
84
86
85
foreach (\range ($ method ['startLine ' ], $ method ['endLine ' ]) as $ line ) {
87
- if (isset ($ coverage [$ line ]) && ($ coverage [$ line ] !== null )) {
88
- $ methodCount = \max ($ methodCount , \count ($ coverage [$ line ]));
86
+ if (isset ($ coverageData [$ line ]) && ($ coverageData [$ line ] !== null )) {
87
+ $ methodCount = \max ($ methodCount , \count ($ coverageData [$ line ]));
89
88
}
90
89
}
91
90
@@ -150,7 +149,7 @@ public function process(CodeCoverage $coverage, $target = null, $name = null)
150
149
$ xmlClass ->appendChild ($ xmlMetrics );
151
150
}
152
151
153
- foreach ($ coverage as $ line => $ data ) {
152
+ foreach ($ coverageData as $ line => $ data ) {
154
153
if ($ data === null || isset ($ lines [$ line ])) {
155
154
continue ;
156
155
}
0 commit comments