@@ -327,14 +327,14 @@ public function append(array $data, $id = null, $append = true, $linesToBeCovere
327327
328328 $ this ->tests [$ id ] = array ('size ' => $ size , 'status ' => $ status );
329329
330- foreach ($ data as $ file => $ lines ) {
330+ foreach ($ data as $ file => $ fileData ) {
331331 if (!$ this ->filter ->isFile ($ file )) {
332332 continue ;
333333 }
334334
335- foreach ($ lines as $ k => $ v ) {
335+ foreach ($ fileData [ ' lines ' ] as $ k => $ v ) {
336336 if ($ v == 1 ) {
337- $ this ->data [$ file ][$ k ][] = $ id ;
337+ $ this ->data [$ file ][' lines ' ][ $ k ][] = $ id ;
338338 }
339339 }
340340 }
@@ -347,22 +347,22 @@ public function append(array $data, $id = null, $append = true, $linesToBeCovere
347347 */
348348 public function merge (PHP_CodeCoverage $ that )
349349 {
350- foreach ($ that ->getData () as $ file => $ lines ) {
350+ foreach ($ that ->getData () as $ file => $ fileData ) {
351351 if (!isset ($ this ->data [$ file ])) {
352352 if (!$ that ->filter ()->isFiltered ($ file )) {
353- $ this ->data [$ file ] = $ lines ;
353+ $ this ->data [$ file ] = array ( ' lines ' => $ fileData [ ' lines ' ]) ;
354354 }
355355
356356 continue ;
357357 }
358358
359- foreach ($ lines as $ line => $ data ) {
359+ foreach ($ fileData [ ' lines ' ] as $ line => $ data ) {
360360 if ($ data !== null ) {
361- if (!isset ($ this ->data [$ file ][$ line ])) {
362- $ this ->data [$ file ][$ line ] = $ data ;
361+ if (!isset ($ this ->data [$ file ][' lines ' ][ $ line ])) {
362+ $ this ->data [$ file ][' lines ' ][ $ line ] = $ data ;
363363 } else {
364- $ this ->data [$ file ][$ line ] = array_unique (
365- array_merge ($ this ->data [$ file ][$ line ], $ data )
364+ $ this ->data [$ file ][' lines ' ][ $ line ] = array_unique (
365+ array_merge ($ this ->data [$ file ][' lines ' ][ $ line ], $ data )
366366 );
367367 }
368368 }
@@ -490,7 +490,7 @@ private function applyCoversAnnotationFilter(array &$data, $linesToBeCovered, ar
490490 {
491491 if ($ linesToBeCovered === false ||
492492 ($ this ->forceCoversAnnotation && empty ($ linesToBeCovered ))) {
493- $ data = array ();
493+ $ data = array (' lines ' => array () );
494494
495495 return ;
496496 }
@@ -512,8 +512,8 @@ private function applyCoversAnnotationFilter(array &$data, $linesToBeCovered, ar
512512 foreach (array_keys ($ data ) as $ filename ) {
513513 $ _linesToBeCovered = array_flip ($ linesToBeCovered [$ filename ]);
514514
515- $ data [$ filename ] = array_intersect_key (
516- $ data [$ filename ],
515+ $ data [$ filename ][ ' lines ' ] = array_intersect_key (
516+ $ data [$ filename ][ ' lines ' ] ,
517517 $ _linesToBeCovered
518518 );
519519 }
@@ -546,7 +546,7 @@ private function applyIgnoredLinesFilter(array &$data)
546546 }
547547
548548 foreach ($ this ->getLinesToBeIgnored ($ filename ) as $ line ) {
549- unset($ data [$ filename ][$ line ]);
549+ unset($ data [$ filename ][' lines ' ][ $ line ]);
550550 }
551551 }
552552 }
@@ -557,12 +557,12 @@ private function applyIgnoredLinesFilter(array &$data)
557557 */
558558 private function initializeFilesThatAreSeenTheFirstTime (array $ data )
559559 {
560- foreach ($ data as $ file => $ lines ) {
560+ foreach ($ data as $ file => $ fileData ) {
561561 if ($ this ->filter ->isFile ($ file ) && !isset ($ this ->data [$ file ])) {
562- $ this ->data [$ file ] = array ();
562+ $ this ->data [$ file ] = array (' lines ' => array () );
563563
564- foreach ($ lines as $ k => $ v ) {
565- $ this ->data [$ file ][$ k ] = $ v == -2 ? null : array ();
564+ foreach ($ fileData [ ' lines ' ] as $ k => $ v ) {
565+ $ this ->data [$ file ][' lines ' ][ $ k ] = $ v == -2 ? null : array ();
566566 }
567567 }
568568 }
@@ -591,12 +591,12 @@ private function addUncoveredFilesFromWhitelist()
591591 $ uncoveredFiles
592592 );
593593 } else {
594- $ data [$ uncoveredFile ] = array ();
594+ $ data [$ uncoveredFile ] = array (' lines ' => array () );
595595
596596 $ lines = count (file ($ uncoveredFile ));
597597
598598 for ($ i = 1 ; $ i <= $ lines ; $ i ++) {
599- $ data [$ uncoveredFile ][$ i ] = -1 ;
599+ $ data [$ uncoveredFile ][' lines ' ][ $ i ] = -1 ;
600600 }
601601 }
602602 }
@@ -624,7 +624,7 @@ private function processUncoveredFileFromWhitelist($uncoveredFile, array &$data,
624624 }
625625 }
626626
627- $ data [$ file ] = $ fileCoverage ;
627+ $ data [$ file ] = array ( ' lines ' => $ fileCoverage) ;
628628 }
629629 }
630630 }
@@ -812,8 +812,8 @@ private function performUnintentionallyCoveredCodeCheck(array &$data, array $lin
812812
813813 $ message = '' ;
814814
815- foreach ($ data as $ file => $ _data ) {
816- foreach ($ _data as $ line => $ flag ) {
815+ foreach ($ data as $ file => $ fileData ) {
816+ foreach ($ fileData [ ' lines ' ] as $ line => $ flag ) {
817817 if ($ flag == 1 &&
818818 (!isset ($ allowedLines [$ file ]) ||
819819 !isset ($ allowedLines [$ file ][$ line ]))) {
0 commit comments